System.Uri myURi = new System.Uri("http://20.1.128.37:80/webdav/good.bmp");
FileStream inStream = File.OpenRead("D://good.bmp");
BinaryReader binaryRead = new BinaryReader(inStream);
byte[] bytes = binaryRead.ReadBytes((int)binaryRead.BaseStream.Length);
HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(myURi);
req.Method = "PUT";
//req.Headers.Add("Translate", "f");
req.ContentLength = bytes.Length;
req.Credentials = new NetworkCredential("test", "test", "");
Stream outStream = req.GetRequestStream();
outStream.Write(bytes, 0, bytes.Length);
outStream.Close();
HttpWebResponse response = (HttpWebResponse)req.GetResponse();
response.Close();
FileStream inStream = File.OpenRead("D://good.bmp");
BinaryReader binaryRead = new BinaryReader(inStream);
byte[] bytes = binaryRead.ReadBytes((int)binaryRead.BaseStream.Length);
HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(myURi);
req.Method = "PUT";
//req.Headers.Add("Translate", "f");
req.ContentLength = bytes.Length;
req.Credentials = new NetworkCredential("test", "test", "");
Stream outStream = req.GetRequestStream();
outStream.Write(bytes, 0, bytes.Length);
outStream.Close();
HttpWebResponse response = (HttpWebResponse)req.GetResponse();
response.Close();