How to change Location(Url) of a Web Service and Update Web Reference programmatically?
问题 I have web service: http://127.0.0.1/something/someWS.asmx I am adding this as a Web Reference to my app but wont always be Localhost... it might change to http://www.something.com/something/someWS.asmx. How do I change the URL programmatically of my Web Reference? is it as simple as: using (var service = new MyApi.MyApi()) { //txtUrl is the site service.Url = "http://" + txtUrl + "something/someWS.asmx"; } ALSO, once I change it, how do I update it programmatically? (equivalent to right