//----新建文件夾----
private void WebDAVNewFolder_Click(object sender, EventArgs e)
{
try
{
// Create the HttpWebRequest object.
HttpWebRequest objRequest = (HttpWebRequest)HttpWebRequest.Create(@"http://10.57.144.2/WebDAV/new");
// Add the network credentials to the request.
objRequest.Credentials = new NetworkCredential("F3226142", "drm.123");//用户名,密码
// Specify the method.
objRequest.Method = "MKCOL";
HttpWebResponse objResponse = (System.Net.HttpWebResponse)objRequest.GetResponse();
// Close the HttpWebResponse object.
objResponse.Close();
}
catch (Exception ex)
{
throw new Exception("Can't create the foder" + ex.ToString());
}
}