Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想将 HttpClient BaseAddress Uri 存储在我的 ASP.NET MVC4 项目 web.config 上。
在哪个部分添加此配置的正确位置?
在 web.config 中添加这个
<configuration> <appSettings> <add key="BaseAddress" value="http://xxx/"/> </appSettings> </configuration>
像这样获得价值:
ConfigurationManager.AppSettings["BaseAddress"]