.NET Framework Bookmark and Share   
 index > .NET Framework Networking and Communication > Delete a file on server using vb.net
 

Delete a file on server using vb.net

Hi, im using this code to download a file


My
.Computer.Network.DownloadFile ("http://www.google.com/downloads/SomeFile.txt"
, "C:\Documents\SomeFile.txt"
)



but i want to delete the file after i downloaded it and i dont know how, ive spend almost 2 days on the web trying to figure it out, but no luck.

Can anyone help?
daha2002
Use following code to delete file
Dim request As FtpWebRequest = WebRequest.Create("File URL")
request.Method = WebRequestMethods.Ftp.DeleteFile

Dim response As FtpWebResponse = request.GetResponse
Console.WriteLine("Delete status: {0}", response.StatusDescription)
response.Close()


http://msdn.microsoft.com/en-us/library/system.net.ftpwebrequest.aspx



Gaurav Khanna
Khanna Gaurav

You can use google to search for other answers

Custom Search

More Threads

• SmtpClient not sending mails to ids ending with@gamil.com or @yahoo.com or@anyOtherThing.com
• authetification is required error by smtp sending mail
• X509Certificate PKCS7 Problem
• BeginAcceptTcpClient problem
• HttpWebRequest.GetResponse() exception
• TAPI?
• HttpRequestStream.Read() does not return complete message ?
• SMTP email not sending
• please help beginner of net programming
• Windows Logon Displayed on local maching when running ASP.NET applications