salve a tutti, devo controllare dei file presenti in una directory online, il punto è che non so da dove iniziare..
in vb 2012 per windows desktop facevo così:
ora, se provo ad inserire lo stesso codice, naturalmente non va..codice:IMPORTS SYSTEM.NET Public Function GetFileList(ByVal host As String, ByVal username As String, ByVal password As String, ByVal currentdirectory As String) As List(Of String) Dim oFTP As FtpWebRequest = CType(FtpWebRequest.Create(host & currentdirectory), FtpWebRequest) oFTP.Credentials = New NetworkCredential(username, password) oFTP.KeepAlive = True oFTP.Method = WebRequestMethods.Ftp.ListDirectory Dim response As FtpWebResponse = CType(oFTP.GetResponse, FtpWebResponse) Dim sr As StreamReader = New StreamReader(response.GetResponseStream) Dim str As String = sr.ReadLine Dim oList As New List(Of String) While str IsNot Nothing If str.StartsWith(My.Resources.MerchantID) Then oList.Add(str) End If str = sr.ReadLine End While sr.Close() response.Close() oFTP = Nothing Return oList End Function
soluzioni?
grazie in anticipo a tutti per le risposte

Rispondi quotando
