'獲取FTP目錄
Dim ftpupdate As String
ftpupdate = ""
Try
Dim ftprequest As System.Net.FtpWebRequest = System.Net.FtpWebRequest.Create(New Uri(ftppath & ftpdirectory))
Dim ftpresponse As System.Net.FtpWebResponse
With ftprequest
.UseBinary = True
.KeepAlive = False
‘ .Credentials = New System.Net.NetworkCredential("", "")
.Method = System.Net.WebRequestMethods.Ftp.ListDirectory
ftpresponse = .GetResponse
Dim ftpinfo As New System.IO.StreamReader(ftpresponse.GetResponseStream)
ftpupdate = ftpinfo.ReadToEnd.ToString
End With
ftprequest = Nothing
ftpresponse.Close()
ftpresponse = Nothing
Catch ex As Exception
End Try
在家里自己建的FTP上可以,在單位 ftpupdate 是空的。求大神解答
uj5u.com熱心網友回復:
控制權完全在服務端。只要FTP服務器上禁止了列目錄的權限,你就沒有任何辦法。
uj5u.com熱心網友回復:

我也感覺是因為你單位上的ftp服務器設定問題造成。
uj5u.com熱心網友回復:
你用其他軟體登陸上去看看如果可能
可能和模式有關
我很久沒弄有點忘記了
好像有pasv模式和port模式
兩個模式代碼應該是有區別的
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/81876.html
標籤:VB基礎類
下一篇:vb6.0利用ado和mshfelxgrid控制元件匯入excel2003的資料,出現sheet1$不是一個有效的名稱
