Click here to Skip to main content
15,921,028 members

Comments by tek001 (Top 20 by date)

tek001 24-Jun-15 5:03am View    
First of all thanks for answering. I've no choice; the embedded resources are third party ones! My boss asked me to create an application to read and alter values of the keys contained in the other application’s resources .dll files.
tek001 23-Jun-15 6:04am View    
Deleted
Up!
tek001 24-Apr-15 9:34am View    
Hello,

My company asked me to create a WinForm Enterprise Library like graphical interface so that the end users can easily configure their own application’s app.config without working directly with the xml files.
Opening my application and pointing and .exe file, will dynamically creates labels for keys and textboxes for values and so they can browse for logfiles paths, enter the required connection strings information and so on.

Best regards,
Tek001
tek001 24-Apr-15 8:29am View    
Thanks a lot, it works!
tek001 24-Apr-15 7:28am View    
Hi,

I tried treating the app.config file as an XMLFIle so I did this to get the chlidNode of the node <listeners>

:

public void getListeners(string appName)
{
try

{


string FILE_NAME = string.Concat(appName, ".config");

XmlTextReader reader = new XmlTextReader(FILE_NAME);

XmlDocument doc = new XmlDocument();

doc.Load(reader);

reader.Close();

string nodeRoute = "loggingConfiguration";


XmlNodeList elemList = doc.GetElementsByTagName(nodeRoute);

{
foreach (XmlNode elem in elemList)
{

foreach (XmlNode elemChild in elem.ChildNodes)
{
if (elemChild.Name.ToString() == "listeners")
{
int cpt = 0;

foreach (XmlNode item in elemChild.ChildNodes)
{
MessageBox.Show(item.OuterXml.ToString());

cpt++;
}

}
}

}



}





}
catch (Exception ex)
{

errorHandler(ex);

}


}
Now how can I get the different attributes separately?
And since the OuterXml property is read only, how can I do to set values?


Thanks for your help.

Best regards,
Tek001