.NET_STAR

打造技术团队,愿与您共同开创事业!

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: :: 管理 ::

添加Web引用后在Web References目录/添加引用的名称空间(例:WebPhoto)在其目录下/出现Reference.map其cs文件Reference.cs

 

打开该文件,删除其构造函数 例:

public PhotoAdmin() {
            this.Url = global::PhotoTest.Properties.Settings.Default.PhotoTest_WebPhoto_PhotoAdmin;
            if ((this.IsLocalFileSystemWebService(this.Url) == true)) {
                this.UseDefaultCredentials = true;
                this.useDefaultCredentialsSetExplicitly = false;
            }
            else {
                this.useDefaultCredentialsSetExplicitly = true;
            }

 }

 

改写其构造函数内容,为:

public PhotoAdmin()
{
       this.Url = "http://192.168.123.61/photoadmin/photoadmin.asmx";
}

 

即可以为Web服务指定固定的IP路径或域名地址,其中“http://192.168.123.61”可作为变量替换

posted on 2008-10-09 14:49  雷明  阅读(717)  评论(0编辑  收藏  举报