WebRequestMethods.Ftp cd command help

S

saunderl

hello,

I'm trying to send custom commands using the methods object and I am
too dense to figure it out;

FtpWebRequest request =
(FtpWebRequest)WebRequest.Create("ftp://server");
request.Credentials = new NetworkCredential("user", "pwd");
request.Method = "ls";

or CD or any other command I always get this error

System.ArgumentException was unhandled
Message="This method is not supported.\r\nParameter name: value"
Source="System"
ParamName="value"
StackTrace:
at System.Net.FtpWebRequest.set_Method(String value)
at ConsoleTest4.Program.Main(String[] args) in C:\Documents and
Settings\saul01\My Documents\Visual Studio
2005\Projects\ConsoleTests\FtpTest\FtpTest\Class1.cs:line 14
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[]
args)
at System.AppDomain.ExecuteAssembly(String assemblyFile,
Evidence assemblySecurity, String[] args)
at
Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object
state)
at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()


Just a little bit of help would be appreciated!!!!!!!!!

L. Lee Saunders
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top