返回信息流从客户端向服务器上传文件
客户端从服务器下载文件,代码如下
//上传
private void button2_Click(object sender, EventArgs e)
{
WebClient myClient1 = new WebClient();
String localfilePath1 = "C:/Users/Administrator/Desktop/111.pdf";
myClient1.UploadFile("http://localhost:58378/ImageHandler.aspx", localfilePath1);
}
//下载
private void button1_Click_1(object sender, EventArgs e)
{
WebClient myClient2 = new WebClient();
string URLAddress = @"http://localhost:58378/ImageHandler.aspx/C:/Users/Administrator/Desktop/111.docx";
string receivePath = @"F:\";
myClient2.DownloadFile(URLAddress, receivePath +System.IO.Path.GetFileName(URLAddress));
}
上传功能可以实现,下载功能404错误,求问什么原因?
这是一条镜像帖。来源:北邮人论坛 / dot-net / #4761同步于 2016/5/5
该镜像源已超过 30 天没有更新,可能在源站已被删除。
dotNET机器人发帖
请教一个C# winform的编程问题
qing6361992
2016/5/5镜像同步1 回复
订阅后,新回复会通过你的通知中心匿名送达。
1 条回复
http://localhost:58378/ImageHandler.aspx/C:/Users/Administrator/Desktop/111.docx——你确定能从这个地址下载文件???……