私はこれを持っています
<?xml version="1.0"?>
<configuration>
<configSections>
<section name="FBI" type="System.Configuration.NameValueSectionHandler" />
</configSections>
<FBI>
<add key="FilePath" value="D:\C Drive\Desktop\test1.txt"/>
</FBI>
<configuration>
でapp.config
..
そして、新しい場合はコピーするようにを設定しCopy to Output Directory
ました。app.config
プログラムでは、
var section = ConfigurationManager.GetSection("FBI") as NameValueCollection;
FilePath.Text = section["FilePath"];
FilePath
ラベルはどこにありますか。
設定ファイルをに変更すると
D:\C Drive\Desktop\test2.txt
VS(リリースモード)を使用してビルドすると、次のように正しく表示されます
D:\C Drive\Desktop\test2.txt
しかし、リリースフォルダーのapp.configを次のように変更すると
D:\C Drive\Desktop\test3.txt
リリースフォルダ内のexeファイルを直接使用して実行すると、まだ表示されます
D:\C Drive\Desktop\test1.txt
に更新せずにtest3.txt
どういう理由ですか?