c# – 在运行时设置服务URL
发布时间:2020-12-16 00:13:54 所属栏目:百科 来源:网络整理
导读:当我添加“Web引用”时,我们将asmx页面的地址提供给visual studio. 我怎样才能在运行时设置它? 解决方法 只需在调用任何服务方法之前设置对象的Url属性: YourService service = new YourService();service.Url = "http://some.other.url/";// Now you're r
当我添加“Web引用”时,我们将asmx页面的地址提供给visual studio.
我怎样才能在运行时设置它? 解决方法
只需在调用任何服务方法之前设置对象的Url属性:
YourService service = new YourService(); service.Url = "http://some.other.url/"; // Now you're ready to call your service method service.SomeUsefulMethod(); (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |