Good day, I need to do Something like this https://youtu.be/ecvunlsNm9k
But Instead Of using tables, using textboxes In one form, and with different Files, let me explain you with an example: In Form 1, There are 2 Textboxes, and 1 button that button opens a file like in the video, but with the difference that can open different Files (Ex. File A and file B)like File A in one Textbox and File B in the second one.
What I Have Tried.
I've tried doing a list in the application settings of type file, and when the form 1 loads do a for each loop like
foreach (File in List) //Deserialize file in List
But it doesn't allow me to do lists with 'file' type. Thanks.
Update And what if I save Two strings in a XML file, and let's say that now there are 4 textboxes, 2 for file a and another 2 for file B, how can I deserialize that info and place it into that textboxes?
Update 2 I need to deserialize two files, one open in a textbox and another in other Textbox, (This should repeat every time I load the form, like first you select one file and now the app knows which file you selected open it even if you close and open again the app), The XML Values are date, string and bool. update 3 This is my complete code:
The problem is that when I try to open a file, appears the next error: System.InvalidOperationException: 'Error in The document XML (0, 0).' Inner Exception
But Instead Of using tables, using textboxes In one form, and with different Files, let me explain you with an example: In Form 1, There are 2 Textboxes, and 1 button that button opens a file like in the video, but with the difference that can open different Files (Ex. File A and file B)like File A in one Textbox and File B in the second one.
What I Have Tried.
I've tried doing a list in the application settings of type file, and when the form 1 loads do a for each loop like
foreach (File in List) //Deserialize file in List
But it doesn't allow me to do lists with 'file' type. Thanks.
Update And what if I save Two strings in a XML file, and let's say that now there are 4 textboxes, 2 for file a and another 2 for file B, how can I deserialize that info and place it into that textboxes?
Update 2 I need to deserialize two files, one open in a textbox and another in other Textbox, (This should repeat every time I load the form, like first you select one file and now the app knows which file you selected open it even if you close and open again the app), The XML Values are date, string and bool. update 3 This is my complete code:
if (openFileDialog1.ShowDialog() == DialogResult.OK) { if (File.Exists(openFileDialog1.FileName)) { if ((openFileDialog1.OpenFile()) != null) { if (openFileDialog1.FileName != null) { openFileDialog1.Filter = "Analytica Files | *.analy"; XmlSerializer XS = new XmlSerializer(typeof(Reminders.Information)); FileStream FS = new FileStream(openFileDialog1.FileName, FileMode.Open, FileAccess.Read) Information Info = (Information)XS.Deserialize(FS); XS.Deserialize(FS); Settings.Default.Counter++; Settings.Default.Save();
The problem is that when I try to open a file, appears the next error: System.InvalidOperationException: 'Error in The document XML (0, 0).' Inner Exception
Last edited by a moderator: