I’m using Visual C#.NET, and am making an app that uses winforms. I essentially need to open multiple files as strings, and manipulate the data in various places without saving the information back to the file. How do I go about storing this data so that I may use it in various parts of my code?
Share
Why open them “as strings”? Strings in .NET are immutable, so it could get expensive if you are making lots of changes. The normal approach would be to parse / deserialize the data out into an object model, and pass that object model into your forms – i.e.
or similar. Then your form can access properties of the model:
or use data-binding if you really want:
(which will enable 1-way or 2-way binding, depending on whether your model also provides change-notifications)