怎样通过工具实现上传文件?该如何解决

怎样通过工具实现上传文件?
网页代码:
HTML code
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:FileUpload ID="FileUpload1" runat="server" />
        <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="上传" />
    </div>
    </form>
</body>
</html>


可以实现文件上传。

请问如何通过winform实现同样的功能?

能提供一下思路吗,多谢了!

------解决方案--------------------
string filepath = ipt.Value;//jpg http url路径
  #region 下载代码
  System.IO.Stream iStream = null;
  int length = 0;// Length of the file:
  long dataToRead;// Total bytes to read:
  string filename = filepath.Substring(filepath.LastIndexOf(@"/")+1, filepath.Length - filepath.LastIndexOf(@"/")-1); // 下载文件名
  try
  {
  HttpWebRequest request = (HttpWebRequest)WebRequest.Create(filepath);
  HttpWebResponse response = (HttpWebResponse)request.GetResponse();

  byte[] buffer = new byte[4096000];

  Response.ContentType = "application/octet-stream";
  Response.AddHeader("Content-Disposition", "attachment; filename=" + HttpUtility.UrlEncode(filename));
  dataToRead = response.ContentLength;
  while (dataToRead > 0)
  {
  length = response.GetResponseStream().Read(buffer, 0, 4096000);
  Response.OutputStream.Write(buffer, 0, length);
  Response.Flush();
  dataToRead = dataToRead - length;
  }
  }
  catch (Exception ex)
  {
  Response.Write("Error : " + ex.Message);// Trap the error, if any.
  }
  finally
  {
  if (iStream != null)
  iStream.Close();//Close the file.
  }

这是.NET中的文件上传
------解决方案--------------------
winform实现同样的功能。这个很好解决啊。 就是一个文件保存的问题。 如果是保存到服务器端,那么首先把文件用Stream读取到内存里面。然后通过socket 发送到服务端,然后服务端再保存成为响应的文件呗。

至于界面。 放置一个文本框和一个按钮,再直接调用文件选择对话框就行了嘛。