如何从applicationSettings获取价值?

Azh*_*har 5 .net c# app-config web-reference windows-applications

我试图从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>
Run Code Online (Sandbox Code Playgroud)

dic*_*ice 8

不确定我得到的问题,

string s = SDHSServer.Properties.Settings.DOServer_WebReference1_Service;
Run Code Online (Sandbox Code Playgroud)

会得到它