道不远人,深入.net底层技术
业精于勤荒于嬉,行成于思毁于随!
比如你已经用教科书式的方法添加了一个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里面,用的时候去取。
posted on 2008-11-19 12:24  扬帆起航  阅读(319)  评论(0编辑  收藏  举报