ok people, my first post, im relativly new (but still expirienced) to vb
express and currently making a login section for my project...
i have a save, load and delete button where the user would be able to choose from.. i have the save section working where the user would enter thier username and password and it would save to a text box located in c:\ .. that all works.. with my load section i ask the user to input thier username and password, and i read my text file which is in c:\ and tell it to steamread etc.etc.. eventually the code gets the text inside the text file and puts it into a multiline textbox on the form.. at this point everything works fine.. here is my problem:
i need to search this multiline textbox to find the username which the user inputs eg:
username = textbox1.text
i want to the code to search the whole multiline textbox to find this STRING username (textbox1.text) and if the multiline textbox DOES have this specific text then it would display a msgbox such as "Enter the game"
here is my code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim file As System.IO.StreamReader
If System.IO.File.Exists("C:\pokemonlogin.txt") = True Then
If txtlogin.Text <> "" And txtpassword.Text <> "" Then
file = System.IO.File.OpenText("c:\pokemonlogin.txt")
'WHERE TEXTBOX3 is the multiline text box
TextBox3.Text = file.ReadToEnd
'(problem starts from from here)---->
If textbox3.something which represents string = the string in txtlogin.text then
' MsgBox("Please enter a REAL username or create one!!!")
MsgBox("Pokemon Blue Gem Arcade does not detect ANY previous users, please create one")
My problem is I DONT KNOW THE COMMAND TO SAY IF A SPECIFIC STRING IN ONE TEXT BOX EQUALS ANOTHER STRING IN ANOTHER TEXT BOX THEN DISPLAY MESSAGE
i dont want the whole text of one textbox to equal another whole text of another textbox.. i want it to search and find only a specific text (which is a variable, which the user inputs)
EG: user types in textbox1 "johnny"
textbox2 reads a file from c:\ then displays it in textbox2
a command/function which represents "a find string( or sumthing like that" will use the two textboxes to compare each other..
GET MY DRIFT??
Please help me out people... if im not clear enough then please ask.. all help and code would be much appriciated!!!