Question How to store the contents of the controls in the notepad on runtime?

Poornimapriya

Member
Joined
Feb 8, 2011
Messages
8
Location
Chennai, Tamil Nadu, India
Programming Experience
Beginner
Hi this is Poornima. I am working on my real time project where the configuration details will be given on runtime. Based on the configuration details, the next form will be loaded and the data will be exported to the database and spreadsheets from the pop3 server. I have done the extraction work from pop3 server. Now i want to store the configuration details that are provided in the controls present in the form.:confused: I am new to visual basic 2005 and it has the .Net 2.0 Framework. I do want to create the text file as notepad and and i want to save it runtime with the details. I am in hope that you people will me. Thanks in advance.:):):)
 

Budius

Well-known member
Joined
Aug 6, 2010
Messages
137
Location
UK
Programming Experience
3-5
to deal with files you want to import System.IO and use in your project File.Create / File.Open, etc. Check the appropriate documentation and for sure there are thousands of examples on google.

But if the task is simply to store a few settings you should be using the Settings. In the Solution Explorer double click 'My Project' and go to the 'Settings' tab. There you can add the settings your software will need.
So for example if you have the settings "pop3" and "timeout", then in your code is just a matter of using:
VB.NET:
dim pop3_string as string = My.Settings.Pop3
Dim Timeout as integer = My.Settings.timeout
and to change the values in runtime you use
VB.NET:
My.Settings.pop3 = "whatever"
My.Settings.timeout = 1300
My.Settings.Save

much easier than text file, uh ?
 
Top Bottom