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
Post a Comment