打印本文 打印本文 关闭窗口 关闭窗口
ASP.NET实现FTP文件上载类
作者:武汉SEO闵涛  文章来源:敏韬网  点击数2509  更新时间:2009/4/23 10:33:29  文章录入:mintao  责任编辑:mintao
Try

End If

Next

ipAddress = parts(0) & "." & parts(1) & "." & parts(2) & "." & parts(3)

‘在Visual Basic .Net 2002中进行调用。你想移动8位。在Visual Basic .NET 2002中,你必须将此数乘2的8次方。
‘端口=parts(4)*(2^8)
‘进行这个调用,并且用Visual Basic .NET 2003解释当前行。

port = parts(4) << 8
‘确定数据端口数
port = port + parts(5)
s = New Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)
ep = New IPEndPoint(Dns.Resolve(ipAddress).AddressList(0), port)
Try
 s.Connect(ep)
Catch ex As Exception
 MessageString = m_sReply
 Throw New IOException("Cannot connect to remote server.")
‘如果你不能链接到特定的FTP服务器,也就是说,将其布尔值设置为false。
 flag_bool = False
End Try

‘如果你能够链接到特定的FTP服务器,将布尔值设置为true。

flag_bool = True
Return s
End Function

#End Region
End Class

上一页  [1] [2] [3] 

打印本文 打印本文 关闭窗口 关闭窗口