首页 > Web开发 > 详细

上传下载资源

时间:2014-11-10 13:24:01      阅读:143      评论:0      收藏:0      [点我收藏+]
  1. WebClient:提供用于将数据发送到由 URI 标识的资源及从这样的资源接收数据的常用方法。
    bubuko.com,布布扣
     1 WebClient client = new WebClient();
     2 //下载文件
     3 client.DownloadFile(strUrlFilePath, localFilePath);
     4 
     5  //上传文件:打开写入流,写入数据
     6  Stream postStream = webClient.OpenWrite(targetUrl, "PUT");
     7  if (postStream.CanWrite)
     8  {
     9       postStream.Write(postArray, 0, postArray.Length);
    10  }
    11              
    View Code

上传下载资源

原文:http://www.cnblogs.com/JustYong/p/4086751.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!