Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15214

[RESOLVED] Changing app.config file

$
0
0
I have written a program and to make it more user friendly, I decided that instead of 'hiding' a value in the file <progname>.exe.config, I would put a fake value in said file and if the program sees the fake value, it will ask the user for the proper value. Once a proper value is entered, that would then be saved.

Seems simple and everything worked just fine until the save part. My code is very simple:
Code:

My.Settings.ImageFolder = strImageFolder
My.Settings.Save()

When the program exits, the file D:\Users\<myuser>\AppData\Local\<myCompany>\<progName>.vshost.exe_Url_w0g22drgbdpf0co5rlclb1t5htehum f3\1.0.0.0 is written. However, when the program runs the next time, the 'If' statement that checks the setting, specifically
Code:

Dim strImageFolder As String = My.Settings.ImageFolder
If strImageFolder = "foobar" Then

is positive. Basically, the program (running in Debug) mode is reading the file either in C:\Users\<myuser>\Documents\Visual Studio 2012\Projects\<progName>\<progName> in the folder \bin\release below this directory and not the file that was just saved.

Is there a way to get the Settings.Save command to write one of the files that is being read or to modify the program so that it reads the modified file? Thanks.

Viewing all articles
Browse latest Browse all 15214

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>