请大家帮忙给一个c#的例子 我只需要上传文件 谢谢了

解决方案 »

  1.   

    http://blog.csdn.net/veryhappy/archive/2006/01/16/581072.aspx
      

  2.   

    WebClient类Console.Write("\nPlease enter the URL to post data to : ");
    String uriString = Console.ReadLine();// Create a new WebClient instance.
    WebClient myWebClient = new WebClient();Console.WriteLine("\nPlease enter the fully qualified path of the file to be uploaded to the URL");
    string fileName = Console.ReadLine();Console.WriteLine("Uploading {0} to {1} ...",fileName,uriString);                        
    // Upload the file to the URL using the HTTP 1.0 POST.
    byte[] responseArray = myWebClient.UploadFile(uriString,"POST",fileName);// Decode and display the response.
    Console.WriteLine("\nResponse Received.The contents of the file uploaded are: \n{0}",Encoding.ASCII.GetString(responseArray));
      

  3.   

    说的详细点好吗 谢谢 我的文件不会大于10M(目前) 用WebClient应该可以吧 有没有例子 给一个 谢谢