sadier

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

1。  发起端:
 WebClient myWebClient = new WebClient();
   string path = Request.Url.ToString();
   path = path.Substring(0,path.LastIndexOf(@"/")+1);
   path = path + @"UpLoadFile.aspx";

   byte[] responseArray = myWebClient.UploadFile(path,"POST",@"d:\MyGod.txt");
2。接受端
void Page_Load(object sender, EventArgs e)
{ foreach(string f in Request.Files.AllKeys)
   {
         HttpPostedFile file = Request.Files[f]; file.SaveAs(@"c:\" + file.FileName); 
   }
 }

posted on 2004-07-26 21:27  毛小华  阅读(1698)  评论(0编辑  收藏  举报