WebClient Client = New WebClient ();
String Txt = Client. downloadstring ( " Http: // localhost/test.html " );
Txt = Txt + " La la Ali " ;
Byte [] Byts = System. Text. encoding. Default. getbytes (txt );
Stream stream = Client. openwrite ( " Http: // localhost/test11.html " , " Put " );
Stream. Write (byts, 0 , Byts. Length );
Stream. Close ();
Stream. Dispose ();
If you encounter a 405 problem, consider the following points:
1. Enable the WebClient Service in the service
2. The fileupload folder in IIS is set on the attributes of IIS and physical folders to allow anonymous accounts to be modified.
3. the upload path must be http: // localhost: 8011/fileupload/xx.jpg, not just http: // localhost: 8011/fileupload/
4. IIS attributes. Allow put actions,
Note that the four points are completely uploaded.
From: http://social.msdn.microsoft.com/Forums/zh-CN/295/thread/54eadf9d-71a2-4196-9eb1-969612ca81f3