Estoy haciendo un programa para renombrar un archivo XML de un servidor FTP y me da el siguiente error
“The remote server returned an error: (501) Syntax error in parameters or arguments”
Me pongo a ver el error y en Status veo lo siguiente“System.Net.WebExceptionStatus.ProtocolError”
El programa lo he desarrollado con Microsoft Visual C# 2010 Express.
Yo he probado este programa con Windows 7 y me funciona correctamente, pero probando el programa en Windows Xp no funciona, y el programa tiene que funcionar con Windows XP.
¿Tengo que descargarme alguna librería o instalar algo adicional el Visual C#2010 o en Windows XP?
Mi programa es el siguiente
-----------------------------------------
Código
FtpWebRequest request = null; string filename = "FI_SINC_QH60_S16104_20150615115359.XML;1"; string newfileame = filename.Replace(";1", "_OLD"); request.Method = WebRequestMethods.Ftp.Rename; request.RenameTo = newfileame; request.GetResponse();
-----------------------------------------
Y el error es este:
-----------------------------------------
Not monitored System.Net.WebException
Message=The remote server returned an error: (501) Syntax error in parameters or arguments.
Source=System
StackTrace:
at System.Net.FtpWebRequest.SyncRequestCallback(Object obj)
at System.Net.FtpWebRequest.RequestCallback(Object obj)
at System.Net.CommandStream.Dispose(Boolean disposing)
at System.IO.Stream.Close()
at System.IO.Stream.Dispose()
at System.Net.ConnectionPool.Destroy(PooledStream pooledStream)
at System.Net.ConnectionPool.PutConnection(PooledStream pooledStream, Object owningObject, Int32 creationTimeout, Boolean canReuse)
at System.Net.FtpWebRequest.FinishRequestStage(RequestStage stage)
at System.Net.FtpWebRequest.GetResponse()
at WindowsFormsApplication1.Form1..ctor() in C:\Documents and Settings\SAM844\Desktop\WindowsFormsApplication1\WindowsFormsApplication1\Form1.cs:line 41
at WindowsFormsApplication1.Program.Main() in C:\Documents and Settings\SAM844\Desktop\WindowsFormsApplication1\WindowsFormsApplication1\Program.cs:line 18
at System.AppDomain._nExecuteAssembly(RuntimeAssembly 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, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
-----------------------------------------
Alguna idea??
Gracias por la ayuda