Joch
October 7th, 2005, 03:38 AM
Hi,
I want to store a UserID in a Configuration File so that my program can get it.
My program is called "config_File_test.exe" and the name of the Configuration file is "config_File_test.exe.config". The content of the Configuration file is:
<configuration>
<appSettings>
<add key="userID" value="js" />
</appSettings>
</configuration>
If I put this file in the \bin directory it is deleted when I build my project, but I read that it has to be in this directory. If I put the file there after compiling the project in doesn't work anyway.
I use the following coding to read the userID form the file:
Dim x As String
x = Configuration.ConfigurationSettings.AppSettings.Get("userID")
MsgBox(x)
When debugging it says "x=Nothing".
I'm using Visual Studio .Net 2003.
Can anybody tell me how I can solve this problem?
Joch
I want to store a UserID in a Configuration File so that my program can get it.
My program is called "config_File_test.exe" and the name of the Configuration file is "config_File_test.exe.config". The content of the Configuration file is:
<configuration>
<appSettings>
<add key="userID" value="js" />
</appSettings>
</configuration>
If I put this file in the \bin directory it is deleted when I build my project, but I read that it has to be in this directory. If I put the file there after compiling the project in doesn't work anyway.
I use the following coding to read the userID form the file:
Dim x As String
x = Configuration.ConfigurationSettings.AppSettings.Get("userID")
MsgBox(x)
When debugging it says "x=Nothing".
I'm using Visual Studio .Net 2003.
Can anybody tell me how I can solve this problem?
Joch