I am trying to basically create config files. A text file will hold something like:Name::AdamLocation::Washington
I am trying to grab the first part as the field name (i.e. Name.Text would update the textbox) then put the second part to that .Text. Just not sure where to go or what the best way to build this is. The code below is incomplete because I can't figure out how to update the textboxes.
Thanks for the help!
private void clickImportConfig_ItemClick(object sender, DevExpress.Xpf.Bars.ItemClickEventArgs e) { Stream myStream = null; string fieldUpdate = string.Empty; string fieldUpdateTo = string.Empty; try { using (myStream) { string[] lines = File.ReadAllLines(@"c:\\config.txt"); foreach (string s in lines) { var splitted = Regex.Split(s, "::"); fieldUpdate = splitted[0].ToString(); fieldUpdateTo = splitted[1].ToString(); } } } catch (Exception ex) { MessageBox.Show("Error: Could not read file from disk. Original error: " + ex.Message); } }