设置在运行时服务URL [英] Setting the service URL at runtime

查看:188
本文介绍了设置在运行时服务URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我加入了Web引用我们给的地址给ASMX页到Visual Studio。

When I am adding the "Web Reference" we are giving the address to the asmx page to visual studio.

如何能我设置在运行时?

How Can I set this at run time?

推荐答案

只需设置对象的Url属性调用任何的服务方法之前:

Just set the Url property of the object before you call any of the service methods:

YourService service = new YourService();
service.Url = "http://some.other.url/";

// Now you're ready to call your service method
service.SomeUsefulMethod();

这篇关于设置在运行时服务URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆