在ASP.NET中有fileupload控件。
可是在C#WindowsFormsApplication中怎么实现把客户端的文件上传到服务器呢
新手,请教大神。

解决方案 »

  1.   

    使用 WebClient 异步上载文件
      

  2.   

    方法2
    http://dotnet.aspx.cc/article/d8f961c3-cbc1-4591-143d-236b572eb89f/read.aspx
      

  3.   

    服务器端建立个WEB SERVICE        [WebMethod]
            public void ByteToFile(string key, byte[] b, string PathValue)
            {
                string pathstr = HttpContext.Current.Server.MapPath(PathValue);
                System.IO.MemoryStream ms = new System.IO.MemoryStream(b);
                ms.Write(b, 0, b.Length);
                ms.Position = 0;
                System.Drawing.Image bm = System.Drawing.Image.FromStream(ms, true);
                bm.Save(pathstr);
            }