c# - setting xml file path in web.config file -


my xml file resides in app_data folder of asp.net project. want set path of xml file in web.config file can accessed in class libraries. want because when move project our university computer makes problem. please me write code in web.config file , c# code through can accessed.

also should mention have googled topic , searched on stack overflow nothing matched case

add in configuration section :

<appsettings>     <add key="xmlpath" value="c:/users/jonesy" /> </appsettings> 

then in code :

string path = configurationmanager.appsettings["xmlpath"]; 

you may need add reference system.configuration.


Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -