1、web.config中写入

<appSettings>
    <add key="TokenQPark" value="http://localhost:50243/" />
  </appSettings>

2、 引用System.Configuration.dll

3、string tokenName =ConfigurationManager.AppSettings["TokenQPark"];

或者把2、3步合成一步,即:

string tokenName =System.Configuration.ConfigurationManager.AppSettings["TokenQPark"];

05-11 09:31