Click here to Skip to main content
15,887,477 members
Home / Discussions / C#
   

C#

 
GeneralRe: Hiding Toolbar Pin
Mazdak2-May-04 9:47
Mazdak2-May-04 9:47 
GeneralRe: Hiding Toolbar Pin
Mazdak2-May-04 9:57
Mazdak2-May-04 9:57 
GeneralRe: Hiding Toolbar Pin
Heath Stewart2-May-04 10:18
protectorHeath Stewart2-May-04 10:18 
GeneralRe: Hiding Toolbar Pin
Mazdak2-May-04 21:11
Mazdak2-May-04 21:11 
GeneralRe: Hiding Toolbar Pin
Nick Parker2-May-04 5:02
protectorNick Parker2-May-04 5:02 
GeneralRe: Hiding Toolbar Pin
Mazdak2-May-04 5:16
Mazdak2-May-04 5:16 
GeneralRe: Hiding Toolbar Pin
Nick Parker2-May-04 6:10
protectorNick Parker2-May-04 6:10 
GeneralProblem with app.config and myfile.exe.config Pin
PEDRO_PASAMAR1-May-04 21:03
PEDRO_PASAMAR1-May-04 21:03 
Hello

I'm write a little class based on a sample from VB on VS Help to write values in the configuration file.

<br />
public static void SetStrAppSetting(string setting, string Value)<br />
{<br />
	System.Reflection.Assembly Asm = System.Reflection.Assembly.GetExecutingAssembly();<br />
	string strConfigLoc = Asm.Location;<br />
	string strTemp = strConfigLoc;<br />
	strTemp = System.IO.Path.GetDirectoryName(strConfigLoc);<br />
	System.IO.FileInfo FileInfo = new System.IO.FileInfo(strTemp + "\\" + Path.GetFileName(Application.ExecutablePath) + ".config");<br />
	System.Xml.XmlDocument XmlDocument = new System.Xml.XmlDocument();<br />
	XmlDocument.Load(FileInfo.FullName);<br />
<br />
	System.Xml.XmlNode CnfNode = XmlDocument["configuration"];<br />
	System.Xml.XmlNode AppSettingsNode = CnfNode["appSettings"];<br />
<br />
	foreach (System.Xml.XmlNode Node in AppSettingsNode)<br />
	{<br />
		if (Node.Name == "add")<br />
		{<br />
			if (Node.Attributes.GetNamedItem("key").Value == setting)<br />
			{<br />
				Node.Attributes.GetNamedItem("value").Value = Value;<br />
				break;<br />
			}<br />
		}<br />
	}<br />
<br />
	XmlDocument.Save(FileInfo.FullName);<br />
}<br />


The problem is that the code makes the right thing write values in myfile.exe.config, but the application loads the dynamic properties from the app.config of the project. How I can handle this ?

Thaks

Pedro E. Pasamar Vidal
GeneralRe: Problem with app.config and myfile.exe.config Pin
Heath Stewart2-May-04 6:37
protectorHeath Stewart2-May-04 6:37 
GeneralC#/C++ interoperability Pin
sharonz1-May-04 20:38
sharonz1-May-04 20:38 
GeneralRe: C#/C++ interoperability Pin
Heath Stewart2-May-04 6:34
protectorHeath Stewart2-May-04 6:34 
GeneralTransparent Controls Pin
DougW481-May-04 19:24
DougW481-May-04 19:24 
GeneralRe: Transparent Controls Pin
Heath Stewart2-May-04 6:29
protectorHeath Stewart2-May-04 6:29 
GeneralDesigner Defaults Pin
gUrM33T1-May-04 19:10
gUrM33T1-May-04 19:10 
GeneralRe: Designer Defaults Pin
leppie1-May-04 22:38
leppie1-May-04 22:38 
GeneralHelp with this PieChart control Pin
Alan Zhao1-May-04 16:51
Alan Zhao1-May-04 16:51 
GeneralRe: Help with this PieChart control Pin
leppie1-May-04 22:31
leppie1-May-04 22:31 
GeneralRe: Help with this PieChart control Pin
Alan Zhao2-May-04 13:19
Alan Zhao2-May-04 13:19 
GeneralDeployment to Quick Launch Toolbar Pin
betterc1-May-04 13:18
betterc1-May-04 13:18 
GeneralRe: Deployment to Quick Launch Toolbar Pin
gUrM33T1-May-04 18:07
gUrM33T1-May-04 18:07 
GeneralRe: Deployment to Quick Launch Toolbar Pin
betterc2-May-04 6:08
betterc2-May-04 6:08 
GeneralRe: Deployment to Quick Launch Toolbar Pin
Heath Stewart2-May-04 6:26
protectorHeath Stewart2-May-04 6:26 
GeneralRe: Deployment to Quick Launch Toolbar Pin
betterc2-May-04 6:36
betterc2-May-04 6:36 
GeneralRe: Deployment to Quick Launch Toolbar Pin
Heath Stewart2-May-04 6:56
protectorHeath Stewart2-May-04 6:56 
GeneralRe: Deployment to Quick Launch Toolbar Pin
betterc2-May-04 7:00
betterc2-May-04 7:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.