Created
February 10, 2016 19:21
-
-
Save Fresh-Dev/e517ae61ab9f04b4a7d8 to your computer and use it in GitHub Desktop.
Use StreamReader to stream data to a datagrid.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using (StreamReader reader = new StreamReader(filePathLoadedData, true)) | |
{ | |
string line; | |
int counter = 1; | |
while ((line = reader.ReadLine()) != null) | |
{ | |
try | |
{ | |
string domain = "";string user = "";string pass = ""; | |
string[] readed;line = line.Remove(0, 6);string[] tmp_extracted_domain = line.Split(':'); | |
string tmp_lineNew = tmp_extracted_domain[1];string[] tmp_getServer = tmp_lineNew.Split('@'); | |
user = tmp_extracted_domain[0];pass = tmp_getServer[0];domain = tmp_getServer[1]; | |
dg_loadedFtp.Rows.Add(counter,domain,user, pass, "", ""); | |
counter++; | |
} | |
catch (Exception ex) { } | |
} reader.Close(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment