When downloading the new version, you need to list the directory files, obtain all the files under the directory on the server, and then download them.
However, an error is reported when an XML request is sent.
Httpwebrequest request = (httpwebrequest) httpwebrequest. Create (URL );
Request. headers. Add ("translate: F ");
Request. Credentials = credentialcache. defaultcredentials;
String requeststring = "<? XML version = \ "1.0 \" encoding = \ "UTF-8 \"?> "+
"<A: propfind xmlns: A = \" Dav: \ ">" +
"<A: prop>" +
"<A: displayname/>" +
"<A: iscollection/>" +
"<A: getlastmodified/>" +
"</A: prop>" +
"</A: propfind> ";
Request. method = "PROPFIND ";
If (deep = true)
Request. headers. Add ("depth: infinity ");
Else
Request. headers. Add ("depth: 1 ");
Request. contenttype = "text/XML ";
Request. contentlength = requeststring. length;
Stream requeststream = NULL;
Try
{
Requeststream = request. getrequeststream ();
// Failed to create the stream. 501 error. The server does not support this function!
// But I have set this directory as a "Browse Directory". Dav? is not supported ?? No.
}
Catch (exception ER)
{
Debug. writeline ("Z. J. Chen: can't create a HTTP request stream! "+ Er. Message );
Requeststream. Close ();
}