P
Patrick.Simons
I try to connect a FTPWebRequest through Proxy and VPN to a remote
FTP- server. Sometimes it works sometimes not. When my VB.Net-App
(2005) returns the error on the GetResponse-Method, I'll try to use
the Windows Explorer to go on the FTP-URI and this always works. So
the problem should come from my app.
my simplified code:
Private m_oFTP As FtpWebRequest
Private oResponseDir As FtpWebResponse = Nothing
m_oFTP = FtpWebRequest.Create("ftp://" & m_sFTPIP & "//" &
m_sNetTraDir & "/*.TRA") With m_oFTP
.Credentials = New NetworkCredential(m_sFTPUsr, m_sFTPPwd)
.UseBinary = True
.KeepAlive = True
.Method = WebRequestMethods.Ftp.ListDirectoryDetails
Try
oResponseDir = .GetResponse()
bRc = True
Catch ex As Exception
....
End With
The trace file shows this:
System.Net Verbose: 0 : [3956] WebRequest::Create(ftp://10.70.5.19//
EXPORT/FTP_E02/*.TRA)
System.Net Information: 0 : [3956]
FtpWebRequest#64923656::.ctor(ftp://
10.70.5.19//EXPORT/FTP_E02/*.TRA)
System.Net Verbose: 0 : [3956] Exiting WebRequest::Create() ->
FtpWebRequest#64923656
System.Net Verbose: 0 : [3956] FtpWebRequest#64923656::GetResponse()
System.Net Information: 0 : [3956]
FtpWebRequest#64923656::GetResponse(Method=LIST.)
System.Net Warning: 0 : [3956] WebProxy failed to autodetect a Uri for
a proxy script.
System.Net Warning: 0 : [3956] WebProxy failed to autodetect a Uri for
a proxy script.
System.Net Error: 0 : [3956] Exception in the
FtpWebRequest#64923656::GetResponse - Unable to connect to the remote
server
System.Net Error: 0 : [3956] at
System.Net.FtpWebRequest.GetResponse()
System.Net Verbose: 0 : [3956] Exiting
FtpWebRequest#64923656::GetResponse()
Any ideas...
FTP- server. Sometimes it works sometimes not. When my VB.Net-App
(2005) returns the error on the GetResponse-Method, I'll try to use
the Windows Explorer to go on the FTP-URI and this always works. So
the problem should come from my app.
my simplified code:
Private m_oFTP As FtpWebRequest
Private oResponseDir As FtpWebResponse = Nothing
m_oFTP = FtpWebRequest.Create("ftp://" & m_sFTPIP & "//" &
m_sNetTraDir & "/*.TRA") With m_oFTP
.Credentials = New NetworkCredential(m_sFTPUsr, m_sFTPPwd)
.UseBinary = True
.KeepAlive = True
.Method = WebRequestMethods.Ftp.ListDirectoryDetails
Try
oResponseDir = .GetResponse()
bRc = True
Catch ex As Exception
....
End With
The trace file shows this:
System.Net Verbose: 0 : [3956] WebRequest::Create(ftp://10.70.5.19//
EXPORT/FTP_E02/*.TRA)
System.Net Information: 0 : [3956]
FtpWebRequest#64923656::.ctor(ftp://
10.70.5.19//EXPORT/FTP_E02/*.TRA)
System.Net Verbose: 0 : [3956] Exiting WebRequest::Create() ->
FtpWebRequest#64923656
System.Net Verbose: 0 : [3956] FtpWebRequest#64923656::GetResponse()
System.Net Information: 0 : [3956]
FtpWebRequest#64923656::GetResponse(Method=LIST.)
System.Net Warning: 0 : [3956] WebProxy failed to autodetect a Uri for
a proxy script.
System.Net Warning: 0 : [3956] WebProxy failed to autodetect a Uri for
a proxy script.
System.Net Error: 0 : [3956] Exception in the
FtpWebRequest#64923656::GetResponse - Unable to connect to the remote
server
System.Net Error: 0 : [3956] at
System.Net.FtpWebRequest.GetResponse()
System.Net Verbose: 0 : [3956] Exiting
FtpWebRequest#64923656::GetResponse()
Any ideas...