I know you can delete files and folders using the directory class but is there a way to delete a file that is located on a web server, using the Webclient?
WebClient Class - Provides common methods for sending data to and receiving data from a resource identified by a URI
The WebClient class provides four methods for uploading data to a resource:
-OpenWrite returns a Stream used to send data to the resource.
-UploadData sends a byte array to the resource and returns a byte array containing any response.
-UploadFile sends a local file to the resource and returns a byte array containing any response.
-UploadValues sends a NameValueCollection to the resource and returns a byte array containing any response.
The WebClient class also provides three methods for downloading data from a resource:
-DownloadData downloads data from a resource and returns a byte array.
-DownloadFile downloads data from a resource to a local file.
-OpenRead returns the data from the resource as a Stream.
The webclient uses the http protocol which does not handle file/directory manipulation (other then sending or receiving data).
You'll want to use either the FTP protocol, which is designed for just such things (but requires sockets-programming which can be difficult to learn), or a server-script (such as an Asp.net, Asp, PHP, CGI, ...).
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.