[WebService]请求因 HTTP 状态 404 失败: Not Found。

              解决方法

                System.IO.Stream fs;
                localhost.Upload1 Upload = new localhost.Upload1();//调用webservices
                Upload.Url = "http://192.168.0.195/WebService/Upload.asmx";
                Upload.PreAuthenticate = true;

                Upload.Credentials = System.Net.CredentialCache.DefaultCredentials;//这两句在NET 1.1或2.0下同样有效

                Upload.UseDefaultCredentials = true;//NET 2.0使用
               


                //fs = (System.IO.Stream)oFiles[0].InputStream;
                //fs.Read(b, 0, oFiles[0].ContentLength);//将输入流读入二进制数组中
                Response.Write(Upload.UploadFile(getByte(FileUpload1), fileName,FileUpload1.PostedFile.ContentLength));

posted @ 2009-12-08 11:34  草下飞  阅读(6845)  评论(0编辑  收藏  举报