web config 下配置关键字

在 web config 下 

<appSettings>
<add key="webpages:Version" value="3.0.0.0" />
<add key="webpages:Enabled" value="false" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
<!--跨域配置-->
<add key="cors:allowedMethods" value="*" />
<!--允许那个端口访问-->
<add key="cors:allowedOrigin" value="http://localhost:8080" />
<!--<add key="cors:allowedOrigin" value="http://192.168.0.124:8080" />-->

<add key="cors:allowedHeaders" value="*" />

</appSettings>

添加以下代码

<!--部署时:预约叫号版本号-->
<add key="QueueVersion" value="1" />

在controller中拿到配置的key

string QueueVersion = System.Configuration.ConfigurationManager.AppSettings["QueueVersion"];

 

posted @ 2021-06-08 16:41  眼中有光  阅读(134)  评论(0)    收藏  举报