谁有VB编的FTP DOWNLOAD的程序?

jing 2000-02-18 01:09:00
...全文
198 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
benbenlittle 2000-03-04
  • 打赏
  • 举报
回复
可以试试用winsock控件
jing 2000-02-21
  • 打赏
  • 举报
回复
谢谢各位。littletao快给我吧。My e_mail:jing127@sina.com
thriller 2000-02-21
  • 打赏
  • 举报
回复
MSDN上有VB5完全源代码。
本站好象也有。
littletao 2000-02-21
  • 打赏
  • 举报
回复
有一个半成品的列出ftp下所有文件名的,
要不要?是我一个同学写的,有一些小错误,
他叫我替他看看,不过后来他自己解决了,
给我的是没解决问题之前的版本,但离正确
已经很近了。
'模板: Option Explicit Public Declare Function InternetOpen Lib "wininet.dll" Alias "InternetOpenA" _ (ByVal sAgent As String, ByVal LAccessType As Long, ByVal sProxyName As String, _ ByVal SProxyBypass As String, ByVal lFlags As Long) As Long Public Declare Function InternetConnect Lib "wininet.dll" Alias "InternetConnectA" _ (ByVal hInternetSession As Long, ByVal sServerName As String, _ ByVal nServerPort As Integer, ByVal sUsername As String, _ ByVal sPassword As String, ByVal lService As Long, _ ByVal lFlags As Long, ByVal lContext As Long) As Long Public Declare Function FtpGetFile Lib "wininet.dll" Alias "FtpGetFileA" _ (ByVal hFtpSession As Long, ByVal lpszRemoteFile As String, _ ByVal lpszNewFile As String, ByVal fFailIfExists As Boolean, _ ByVal dwFlagsAndAttributes As Long, ByVal dwFlags As Long, _ ByVal dwContext As Long) As Boolean Public Declare Function FtpPutFile Lib "wininet.dll" Alias "FtpPutFileA" _ (ByVal hFtpSession As Long, ByVal lpszLocalFile As String, _ ByVal lpszRemoteFile As String, ByVal dwFlags As Long, _ ByVal dwContext As Long) As Boolean Public Declare Function FtpDeleteFile Lib "wininet.dll" Alias "FtpDeleteFileA" _ (ByVal hFtpSession As Long, ByVal lpszFileName As String) As Boolean Public Declare Function FtpRenameFile Lib "wininet.dll" Alias "FtpRenameFileA" _ (ByVal hFtpSession As Long, ByVal lpszExsiting As String, ByVal lpszNew As String) As Boolean Public Declare Function InternetCloseHandle Lib "wininet.dll" (ByVal hInet As Long) As Integer Public Declare Function FtpFindFirstFile Lib "wininet.dll" Alias "FtpFindFirstFileA" _ (ByVal hFtpSession As Long, ByVal lpszSearchFile As String, _ lpFindFileData As WIN32_FIND_DATA, ByVal dwFlags As Long, _ ByVal dwContent As Long) As Long Public Declare Function InternetFindNextFile Lib "wininet.dll" Alias "InternetFindNextFileA" _ (ByVal hFind As Long, lpvFndData As WIN32_FIND_DATA) As Long Public Type FILETIME dwLowDateTime As Long dwHighDateTime As Long End Type Public Type WIN32_FIND_DATA dwFilAttributes As Long ftCreationTime As FILETIME ftLastAccessTime As FILETIME ftLastWriteTime As FILETIME nFileSizeHigh As Long nFileSizeLow As Long dwReserved0 As Long dwReserved1 As Long cFileName As String * 260 cAlternate As String * 14 End Type Public Declare Function GetOpenFileName Lib "comdlg32.dll" Alias _ "GetOpenFileNameA" (pOpenfilename As OPENFILENAME) As Long Type OPENFILENAME lStructSize As Long hwndOwner As Long hInstance As Long lpstrFilter As String lpstrCustomFilter As String nMaxCustFilter As Long nFilterIndex As Long lpstrFile As String nMaxFile As Long lpstrFileTitle As String nMaxFileTitle As Long lpstrInitialDir As String lpstrTitle As String flags As Long nFileOffset As Integer nFileExtension As Integer lpstrDefExt As String lCustData As Long lpfnHook As Long lpTemplateName As String End Type '窗体: Private Sub Command1_Click() 'FTP下载 lnginet = InternetOpen(vbNullString, INTERNET_OPEN_TYPE_PRECONFIG, _ vbNullString, vbNullString, 0&) If lnginet Then lnginetconn = InternetConnect(lnginet, "219.131.192.243", 0, _ "posui", "djposui", 1, 0, 0) If lnginetconn Then blnRC = FtpGetFile(lnginetconn, "/load.txt", "c:\load.txt", 0, 0, 1, 0) If blnRC Then MsgBox "download ok!!!" End If InternetCloseHandle lnginetconn InternetCloseHandle lnginet MsgBox "close ok!!!" Else MsgBox "can't connect" End If Else MsgBox "ftp wrong" End If End Sub Private Sub Command2_Click() 'FTP上传 lnginet = InternetOpen(vbNullString, INTERNET_OPEN_TYPE_PRECONFIG, _ vbNullString, vbNullString, 0&) If lnginet Then lnginetconn = InternetConnect(lnginet, "219.131.192.243", 0, _ "administrator", "vai8888", 1, 0, 0) If lnginetconn Then blnRC = FtpPutFile(lnginetconn, "c:\1.txt", "/1.txt", 0, 0) If blnRC Then MsgBox "download ok!!!" End If InternetCloseHandle lnginetconn InternetCloseHandle lnginet MsgBox "close ok!!!" Else MsgBox "can't connect" End If Else MsgBox "ftp wrong" End If End Sub 方法2: '部件INET Private Sub Command1_Click() Me.Inet1.Execute Me.Inet1.URL, "send c:\11.txt /1.txt" '保存 End Sub Private Sub Command2_Click() Me.Inet1.Execute Me.Inet1.URL, "get /2.txt c:\2.txt" '下载 End Sub
如题所示,VB代码1000例 1000s of Visual Basic Source Code examples 由于文件较大,所以我是分开来压的~ 这个文件可以单独使用~~~~ 我不是学VB的,但是我觉得这个还是很有用的~给你们看看更目录,你们就知道有什么了…… 根目录: Read Me.txt VB6 and ASP VB6 and Bas Files VB6 and CAB files VB6 and Controls VB6 and Conversions VB6 and DAT Files VB6 and Email VB6 and Encryption VB6 and Extraction VB6 and Files VB6 and Firewalls VB6 and Forms VB6 and Graphics VB6 and Help VB6 and Icons VB6 and Images VB6 and Information VB6 and Internet VB6 and Keyboard VB6 and Make Exe VB6 and Math VB6 and Media VB6 and Menus VB6 and Mp3 VB6 and Networking VB6 and Registry VB6 and SQL VB6 and ScreenSavers VB6 and Security VB6 and Shell VB6 and Source Codes VB6 and Time VB6 and Windows 这些文件夹中的内容是显而易见的吧~~~~~~ 为需求者提供~~~~喜欢的就下吧~~~ 声明: VB代码1000例 1000s of Visual Basic Source Code examples 由于文件较大所以我分 成了很多部分。 VB代码1000例第一部分(可单独使用) http://download.csdn.net/source/2029561 VB代码1000例第二部分(可单独使用) http://download.csdn.net/source/2029307 VB代码1000例—第三部分(可单独使用) http://download.csdn.net/source/2028511 由于期中VB6 and Media很大,所以我又分成了很多部分 VB and Media部分_第一部分 (不可单独使用) http://download.csdn.net/source/2029648 VB and Media部分_第二部分 (不可单独使用) http://download.csdn.net/source/2029683 VB and Media部分_第三部分 (不可单独使用) http://download.csdn.net/source/2029909 VB and Media 要三个都下载后才能解压压缩包。 注意: 有些需要一些 ***.ocx ****.dll等,它里面附有压缩包包含了一些链接库等,有些事直接安装的。 还有可能有些是不完整的系统,也可能缺少些连接库,这些我也不了解,也只是猜测。 一些实例下载: 网站下载器实例 http://download.csdn.net/source/2030032 vbftp工具 实例 http://download.csdn.net/source/2030021 midi的实例,midi钢琴 很好玩的 http://download.csdn.net/source/2029981 有问题就联系我: Email:514403150@qq.com

7,763

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧