public void ProcessRequest(HttpContext hc)
{
foreach (string fileKey in hc.Request.Files)
{
HttpPostedFile file = hc.Request.Files[fileKey];
file.SaveAs(Path.Combine(hc.Server.MapPath("."), file.FileName));
}
}
public bool IsReusable
{
get
{
return false;
}
}
客户端的代码
System.Net.WebClient myWebClient = new System.Net.WebClient();
myWebClient.UploadFile("http://localhost:20513/Handler1.ashx", "POST", fileName);