您的位置:首页 > 理论基础 > 计算机网络

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

2009-12-08 11:34 465 查看
解决方法

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));
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐