»
 

Go Back   ResellerRatings Store Ratings > ResellerRatings Forums > Tech Support

Reply
 
LinkBack Thread Tools Display Modes
Old 07-20-2003, 04:20 AM   #1 (permalink)
Guest
Guest
 
Posts: n/a
Systems VB 6 Code q

ok .... heres my prob ... I am running a version of "ftp client" from http://freevbcode.com/ShowCode.Asp?ID=1593 ...... now I filled in the "address " and "password" field, and just for an experiment i want to be able to click a command button and have it put the login username in ... so i made a command button with the following code

Private Sub Command1_Click()
txtUser.Text = "backitup"
End Sub

txtUser being the name of the text thing i want to fill in ... so now i run the file and only 1 problem .... the text "backitup" is already there and has loaded without me even clicking the command button .... the command button works and all becuz it reloads the text but why isnt it blank until i hit the command button??? a pic is shown below ... the "username" should be blank until command 1 is hit ...




not that i think it matters but runing XP pro , VB 6 Enterprise msdn edition

  Reply With Quote
Old 07-20-2003, 05:02 AM   #2 (permalink)
Registered User
 
Carl-cox-'s Avatar
 
Join Date: Nov 2002
Location: Kent England
Posts: 235
Carl-cox- is on a distinguished road
is it already added in the propities of the txtbox if it is delete it

if that doesnt work try adding

txtUser.Text = ""

to the form load event see if that helps
Carl-cox- is offline   Reply With Quote
Old 07-20-2003, 09:21 AM   #3 (permalink)
Registered User
 
Join Date: Oct 2001
Location: TOO close to Wash DC
Posts: 7,956
vass0922 is on a distinguished road
do a search through the code for "txtuser.text" and see if maybe there is some lingering test code that was forgotten. Agreed with carl check the properties as well.
__________________
<< Insert exceedingly large and overly verbose message of how 1337 you are here including full specs of every vehicle you've ever driven and PC you've owned >>
vass0922 is offline   Reply With Quote
Old 07-20-2003, 03:08 PM   #4 (permalink)
Guest
Guest
 
Posts: n/a
err

no .... that didnt work ... the only thing i can think of i just remembered is that when you enter your login nfo it saves it somehow ..... so it must be saved .... hopefully ... but where is it saved :S it says the txt file its saved to but i did a search on my comp both drives, no return
  Reply With Quote
Old 07-20-2003, 03:11 PM   #5 (permalink)
Guest
Guest
 
Posts: n/a
code

heres the save c0de im talking bout'

Private Sub cmdConnect_Click()
mWait
If mFTP.OpenConnection(txtServer.Text, txtUser.Text, txtPassword.Text) Then
mFTP.SetFTPDirectory "/"
Me.Caption = "Connected to " & txtServer.Text & " as " & txtUser.Text & " at " & Now
RefreshDirectoryListing
SaveSetting "eDIY FTP Client", "Settings", "Server", txtServer.Text
SaveSetting "eDIY FTP Client", "Settings", "User", txtUser.Text
SaveSetting "eDIY FTP Client", "Settings", "Password", txtPassword.Text










heres the code on the txtuser text block


Private Sub txtUser_GotFocus()
txtUser.Text = ""
txtUser.SelStart = 0
txtUser.SelLength = 255
End Sub
  Reply With Quote
Old 07-20-2003, 03:17 PM   #6 (permalink)
Registered User
 
Join Date: Oct 2001
Location: TOO close to Wash DC
Posts: 7,956
vass0922 is on a distinguished road
well nothing in there uses VB functions to save the data anywhere. It maybe inside the SaveSetting function but that doesn't tell you where its going.

Maybe C&P the code up here for the rest of the form?
(if you do, please use the [ code ] tag to keep the formatting correctly)
Just so we can see where the problem is a little better.

Hmmm you set the text box to "" but you want all of that (nothing) selected

oh and where's my manners

Welcome to TechIMO!
__________________
<< Insert exceedingly large and overly verbose message of how 1337 you are here including full specs of every vehicle you've ever driven and PC you've owned >>

Last edited by vass0922; 07-20-2003 at 03:19 PM.
vass0922 is offline   Reply With Quote
Old 07-22-2003, 11:51 PM   #7 (permalink)
Registered User
 
Join Date: Sep 2002
Posts: 265
Creosote is on a distinguished road
SaveSetting is a reserved VB function that writes to the registry.

There has to be a GetSetting in there on Form_Load or Form_Activate that is pulling the settings back out.

Each time you connect, it is saving the current value in there for the next time it is loaded.
Creosote is offline   Reply With Quote
Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Most Active Discussions

Recent Discussions

All times are GMT -6. The time now is 04:59 AM.