I use WebClient and DownloadString to get RAW text file into an string, and I would like to get the first words, like each thing before : char in to a string, AND also the stuff after : but before ; in other string. In this case I want word111 and floor271 in seperate string, and table123 and fan891 into an other string.
The text file looks like this:
word111:table123;
floor271:fan891;
I've tried to look around for days, because I use in my code the Contains method to see if the whole line of text sometimes matches, example word111:table123; if that exists in the raw text file, then the code continues. I looked at Split, IndexOf, and things like that but I don't understand if they can even achieve this goal, because I need them from every row/line, not just one.
WebClient HWIDReader = new WebClient();
string HWIDList = HWIDReader.DownloadString("/*the link would be here, can't share it*/");
if (HWIDList.Contains(usernameBox.Text + ":" + passwordBox.Text))
{
/* show other form because username and password did exist */
}
I expect the code wouldn't work with Split, because it can split the string by : and ; characters tho, but I don't want the usernames and passwords visible in the same string. IndexOf would delete before or after specified characters tho. (Maybe can use IndexOf to both ways? to remove from : till ; is that possible, and how?) Thank you in advance.
You can split the string based on the newline character.