我想从<appSettings>我web.config文件中的部分中检索一个值.钥匙被命名imgServer.
我试过这个,但它不起作用:
Label1.Text = System.Configuration.ConfigurationSettings.AppSettings.Get("imglServer");
Run Code Online (Sandbox Code Playgroud)
然后我尝试了:
Label1.Text = ConfigurationSettings.AppSettings["imgServer"];
Run Code Online (Sandbox Code Playgroud)
但这也不起作用.
我究竟做错了什么?