lucausa75
21-12-2010, 19:27
Salve ragazzi,
con questa porzione di codice riesco a collegarmi ad un mio FTP:
Public Function CheckIfFileContains(ByVal Path As String, ByVal SearchStr As String) As Boolean
Dim RetList = New List(Of String)
If (Path = Nothing Or Path = "") Then
Path = "/"
End If
_FtpRequest = CType(WebRequest.Create("ftp://" + _Host + Path), FtpWebRequest)
_FtpRequest.Credentials = New NetworkCredential(_UserName, _Password)
_FtpRequest.UsePassive = False
_FtpRequest.Method = WebRequestMethods.Ftp.ListDirectoryDetails
_FtpRequest.EnableSsl = _UseSSL
_FtpRequest.Proxy = Nothing
_FtpResponse = CType(_FtpRequest.GetResponse(), FtpWebResponse)
vorrei aggiungere le righe di codice necessarie in modo da verificare se tra i file nell'FTP c'è qualcuno il cui nome contiene una stringa da me prescelta e che fa diventare la funzione di cui sopra CheckIfFileContains TRUE...
con questa porzione di codice riesco a collegarmi ad un mio FTP:
Public Function CheckIfFileContains(ByVal Path As String, ByVal SearchStr As String) As Boolean
Dim RetList = New List(Of String)
If (Path = Nothing Or Path = "") Then
Path = "/"
End If
_FtpRequest = CType(WebRequest.Create("ftp://" + _Host + Path), FtpWebRequest)
_FtpRequest.Credentials = New NetworkCredential(_UserName, _Password)
_FtpRequest.UsePassive = False
_FtpRequest.Method = WebRequestMethods.Ftp.ListDirectoryDetails
_FtpRequest.EnableSsl = _UseSSL
_FtpRequest.Proxy = Nothing
_FtpResponse = CType(_FtpRequest.GetResponse(), FtpWebResponse)
vorrei aggiungere le righe di codice necessarie in modo da verificare se tra i file nell'FTP c'è qualcuno il cui nome contiene una stringa da me prescelta e che fa diventare la funzione di cui sopra CheckIfFileContains TRUE...