English 中文(简体)
Accessing App.exe.config file in Special Folders
原标题:Accessing App.exe.config File in Special Folders

所有这一切,我都是在申请时采用书面申请。 exe.config file using

Properties.Settings.Default.SomeSetting = someVal;
Properties.Settings.Default.Save();

我被要求在设施之间保持环境,有两条线路;转向使用登记处,或将编织档案保存到各设施之间持续存在的一个单独的特别激光器(我选择了后来由于环境数量而选择)。

我的议事录用了奇迹,即:

C:UsersAdministratorAppDataLocalMyApp
    MyApp.vshost.exe_Url_mzfwtdo5po4pcuabybebhsn5yfltbb3w1.0.0.0

www.un.org/spanish/ecosoc 我的问题是:我如何在C#中摘取这一名录?。

注:我已尝试

string appPath = Application.ExecutablePath;
Configuration config = ConfigurationManager.OpenExeConfiguration(appPath);
string strIPACostConfigFile = config.FilePath;

这给我带来了安装名录中的首选。

感谢你们的时间。

最佳回答

你们不必知道你们的公交档案的位置。 你只需要一个“<代码>true”的栏目,并在你的节目开始时发出以下呼吁。

if (Settings.Default.IsUpgrade)
{
  Settings.Default.Upgrade();
  Settings.Default.IsUpgrade = false;
  Settings.Default.Save();
}

这样,较早版本的环境将移至新的环境。

问题回答

我的问题是:我如何在C#中摘取这一名录?

我们不能。 App.exe.config文档可以位于两个地点之一,除非你装载、生成和节省配置文件,否则你将无法将其定位在你想要的地点。

Of course the location that Microsoft decided upon is the correct location for it





相关问题
Bring window to foreground after Mutex fails

I was wondering if someone can tell me what would be the best way to bring my application to the foreground if a mutex was not able to be created for a new instance. E.g.: Application X is running ...

How to start WinForm app minimized to tray?

I ve successfully created an app that minimizes to the tray using a NotifyIcon. When the form is manually closed it is successfully hidden from the desktop, taskbar, and alt-tab. The problem occurs ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

Handle DataTable.DataRow cell change event

I have a DataTable that has several DataColumns and DataRow. Now i would like to handle an event when cell of this DataRow is changed. How to do this in c#?

Apparent Memory Leak in DataGridView

How do you force a DataGridView to release its reference to a bound DataSet? We have a rather large dataset being displayed in a DataGridView and noticed that resources were not being freed after the ...

ALT Key Shortcuts Hidden

I am using VS2008 and creating forms. By default, the underscore of the character in a textbox when using an ampersand is not shown when I run the application. ex. "&Goto Here" is not ...

WPF-XAML window in Winforms Application

I have a Winforms application coded in VS C# 2008 and want to insert a WPF window into the window pane of Winforms application. Could you explain me how this is done.

热门标签