level 1
Public Function list(ByVal strFilePath As String) As String
Dim ftpStream As NetworkStream
'ftpStream = New NetworkStream
ftpStream = myftpCreate.GetResponseStream
Dim returnMessage As String
FTPCommands(ftpStream, "PASV", returnMessage)
Dim DownloadStream As NetworkStream
DownloadStream = GetConnectTcpClient(returnMessage)
FTPCommands(ftpStream, "TYPE I ", returnMessage)
FTPCommands(ftpStream, "LIST " + strFilePath, returnMessage)
returnMessage = "-- 目录文件消息 --" + vbCrLf + returnMessage
Dim listlen As Long
Dim lst() As Byte
ReDim lst(1024)
Dim UPFile As New FileStream("f:/1.txt", FileMode.Open)
Do
listlen = DownloadStream.Read(lst, 0, 1024)
UPFile.Write(lst, 0, listlen)
Loop While listlen > 0
Return returnMessage
ftpStream.Close()
End Function这段代码老提示""未将对象引用设置到对象的实例。""
2012年03月07日 00点03分