Accessing web.config from a classic asp program
I have a application in which there is a web.config file. I have to use a classic asp file and I need to access web.config configuration sections wit开发者_StackOverflow社区h classic asp file.
How can I access the web.config file from a classic asp program?
I find some resouces which was recommending to use a dom parser and access the values with a parser.
Is there a better way?
ex:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="mykey" value="myvalue"/>
</appSettings>
</configuration>
I wanna be able to read this config file from a classic asp file. Classic asp file uses jscript.
You could write a .NET class library that loads the XML configuration and exposes the needed properties to COM.
You should be able to use
MyVar = WebConfigurationManager.AppSettings("myKey")
In the code behind to read that value.
精彩评论