动态加载Web Service

比如你已经用教科书式的方法添加了一个Web Referece,然后现在这个Web Service内容没有变,只是换了各地方。比如从localhost:8080/a.asmx换到了localhost:8090/a.asmx。如此一来你不必重新修改Web Reference只需要在使用WebMethod时
WebS.A a = new WebS.A();
a.Url="http://localhost:8090/a.asmx"
a.remoteDosth();
就可以了!

可以把Url字符串存到config里面,用的时候去取。
简单罢?

转载于:https://www.cnblogs.com/civ3/archive/2006/08/10/473835.html

猜你喜欢

转载自blog.csdn.net/weixin_34409703/article/details/93571526