I want to make a program in which the button (btnSteal) would be clicked, and it would output txtName and txtPass on 2 different lines in a text file. How would I go about coding that button?
Printable View
I want to make a program in which the button (btnSteal) would be clicked, and it would output txtName and txtPass on 2 different lines in a text file. How would I go about coding that button?
It seems by your post count that you are still new here, welcome. I think you'll get faster answers if you try searching the forums first before asking a question. A lot of times someone else has already asked the same question and then you don't have to post and wait for someone to respond. Of course if you don't find an answer or understand one then by all means post. I don't mean to discourage or offend you by this either, I'm only trying to help.
Now having said all that you may find this post helpful:
http://www.vbforums.com/showthread.p...hreadid=276061
It shows how to save things to a text file.
i dont get it... i want it 2 take 2 text boxes and save them... i got it 2 save the file now, but its an empty file.. how do i tell it what 2 put in the file??
In the sample code posted in that thread it uses the line: sw.writeline(itm.ToString) to actually write a line in the text file. So what you want to do is put the information you want written there instead of item.ToString. For instance if I had a textbox named txtUser then I'd use: sw.Writeline(txtUser.Text)
wha??? heres my code so far...VB Code:
username = Me.txtName.Text password = Me.txtPass.Text Dim random As Integer = Rnd() * 9554574 Dim strFilename As String = "C:\" & username & random & ".txt" Dim testfile As New FileInfo(strFilename) testfile.Create() MessageBox.Show("Error in 0x00002102341. Program will terminate." & vbCrLf & "If this problem persists, please restart your computer.")
you're not following what Edneeis told you. See the link he gave you and use that. SW.WriteLine( thingsThatYouWantToWriteToDaFile )Quote:
Originally posted by Synth3t1c
wha??? heres my code so far...VB Code:
username = Me.txtName.Text password = Me.txtPass.Text Dim random As Integer = Rnd() * 9554574 Dim strFilename As String = "C:\" & username & random & ".txt" Dim testfile As New FileInfo(strFilename) testfile.Create() MessageBox.Show("Error in 0x00002102341. Program will terminate." & vbCrLf & "If this problem persists, please restart your computer.")