![]() |
|
[.NET] Importing USER:PASS txt file to Textboxes - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [.NET] Importing USER:PASS txt file to Textboxes (/showthread.php?tid=5787044) |
Importing USER:PASS txt file to Textboxes - ThatAlbinoFrog - Jan 19, 2018 How would I got about importing a txt file with login details formatted like - USERNAME1:PASSWORD1 USERNAME2:PASSWORD2 USERNAME3:PASSWORD3 I want to import the text file, then have the USER go into one textbox and the PASSWORD go into the other. Sorry if this is worded poorly, I'm pretty new to coding, and I'm completely lost when it comes to this. This is kinda what I'm trying to do in a really dumb way - Code OpenFileDialog1.ShowDialog()Thanks heaps! RE: Importing USER:PASS txt file to Textboxes - Unknown - Jan 19, 2018 I'd say the easiest way to do something like this would be with string.Split Example: Code Dim combo As String = "username:password"Spoiler (Click to View) RE: Importing USER:PASS txt file to Textboxes - Ninja - Jan 19, 2018 (Jan 19, 2018 03:07 AM)Cynn. Wrote: I'd say the easiest way to do something like this would be with string.Split Though it would be best to save the array when you split so you don't have to keep splitting. Like this: Code Dim combo As String = "username:password"RE: Importing USER:PASS txt file to Textboxes - Unknown - Jan 19, 2018 (Jan 19, 2018 04:00 AM)Ninja Wrote: Though it would be best to save the array when you split so you don't have to keep splitting. Like this:^ I didn't even think of that, thanks for adding onto it Ninja RE: Importing USER:PASS txt file to Textboxes - ThatAlbinoFrog - Jan 19, 2018 (Jan 19, 2018 03:07 AM)Cynn. Wrote: I'd say the easiest way to do something like this would be with string.Split (Jan 19, 2018 04:00 AM)Ninja Wrote: Though it would be best to save the array when you split so you don't have to keep splitting. Like this: Thanks for the help guys! I'll test it out tomorrow when I'm with my laptop RE: Importing USER:PASS txt file to Textboxes - ThatAlbinoFrog - Jan 19, 2018 It works great, thanks heaps guys! |