【发布时间】:2025-12-28 13:35:12
【问题描述】:
我正在尝试从 app.config 获取我的应用程序中的服务价值。我必须将它发送到显示 URL 的应用程序。我在此应用程序中使用的 Web 服务也在使用它,因此无法将其移动到 appSettings。
我想通过c#代码得到这个值'http://192.168.4.22:82/Service.asmx'。
<applicationSettings>
<SDHSServer.Properties.Settings>
<setting name="DOServer_WebReference1_Service" serializeAs="String">
<value>http://192.168.4.22:82/Service.asmx</value>
</setting>
</SDHSServer.Properties.Settings>
</applicationSettings>
【问题讨论】:
-
或more strongly typed manner。使用 ASP.NET 应用程序,但认为没有太大区别。
-
您上面的 sn-p 显示您尝试获取的设置已经 在 appSettings 中,您说您不想这样做。是哪个?
标签: c# .net app-config windows-applications web-reference