How Can I Perform Command On FTP Server ?

Hi

How Can I (Delete File, Rename, Create Directory , ext..) from the FTP Server with the Help of FTP Classes in .NET Framework 2.0

I have the following Code to Delete the File From FTP Server


FtpWebRequest ftpRequest = (FtpWebRequest)WebRequest.Create("ftp://localhost/FileName.txt");

ftpRequest.Credentials =newNetworkCredential(this.username,this.password);

ftpRequest.Method =WebRequestMethods.Ftp.DeleteFile;




But How Can I send the command to perform the deletion ?

And Thanks with my regarding
Fraas

[1431 byte] By [Fraas] at [2008-3-7]
# 1

FtpWebRequest request = (FtpWebRequest)WebRequest.Create("ftp://machine/file.htm");
request.Proxy = null;
request.Method = "DELE";
FtpWebResponse response = (FtpWebResponse)request.GetResponse();
response.Close();
For RETR, LIST, NLST, requests can go through proxy. If credentials not specified ftp connection is made as anonymous user

Malar at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Framework Networking and Communication...
# 2
thanks Malar for your reply
but also I have another Question Smile

How can I get information when I want to get information about Directory Content information.


ftpRequest.Method = WebRequestMethods.Ftp.ListDirectoryDetails



How can I get the information for this request (ListDirectoryDetails) ?

thanks with my regarding

Fraas at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Framework Networking and Communication...
# 3
Regarding of my last question I have search in google and I get the correct answer in this URL

http://blogs.msdn.com/adarshk/archive/2004/09/15/230177.aspx

thanks

Fraas at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Framework Networking and Communication...

.NET Development

Site Classified