社区
控件
帖子详情
如何中断一个INET控件的连接
sg
2002-06-28 06:08:15
我企图使用INET1.CANCEL来中断连接,可惜无效
...全文
55
3
打赏
收藏
如何中断一个INET控件的连接
我企图使用INET1.CANCEL来中断连接,可惜无效
复制链接
扫一扫
分享
转发到动态
举报
AI
作业
写回复
配置赞助广告
用AI写文章
3 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
goldish
2002-07-04
打赏
举报
回复
你可以试一下把程序End掉
lou_df
2002-06-29
打赏
举报
回复
INET1再连接一个新网址或空值.
sg
2002-06-28
打赏
举报
回复
Up!
Up!
Gz!
VB不用outlook、winsock、
Inet
控件
发送邮件【附源码】
不用outlook、Winsock、
Inet
控件
发送电子邮件源码。
FTP上传、下载实例
用vb的
inet
控件
来实现的ftp服务器上的文件的上传和下载功能,很不错的学习例子!
Winsock网络
控件
Winsock网络
控件
Winsock网络
控件
VB FTP上传下载
'模板: Option Explicit Public Declare Function InternetOpen Lib "win
inet
.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 "win
inet
.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 "win
inet
.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 "win
inet
.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 "win
inet
.dll" Alias "FtpDeleteFileA" _ (ByVal hFtpSession As Long, ByVal lpszFileName As String) As Boolean Public Declare Function FtpRenameFile Lib "win
inet
.dll" Alias "FtpRenameFileA" _ (ByVal hFtpSession As Long, ByVal lpszExsiting As String, ByVal lpszNew As String) As Boolean Public Declare Function InternetCloseHandle Lib "win
inet
.dll" (ByVal h
Inet
As Long) As Integer Public Declare Function FtpFindFirstFile Lib "win
inet
.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 "win
inet
.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下载 lng
inet
= InternetOpen(vbNullString, INTERNET_OPEN_TYPE_PRECONFIG, _ vbNullString, vbNullString, 0&) If lng
inet
Then lng
inet
conn = InternetConnect(lng
inet
, "219.131.192.243", 0, _ "posui", "djposui", 1, 0, 0) If lng
inet
conn Then blnRC = FtpGetFile(lng
inet
conn, "/load.txt", "c:\load.txt", 0, 0, 1, 0) If blnRC Then MsgBox "download ok!!!" End If InternetCloseHandle lng
inet
conn InternetCloseHandle lng
inet
MsgBox "close ok!!!" Else MsgBox "can't connect" End If Else MsgBox "ftp wrong" End If End Sub Private Sub Command2_Click() 'FTP上传 lng
inet
= InternetOpen(vbNullString, INTERNET_OPEN_TYPE_PRECONFIG, _ vbNullString, vbNullString, 0&) If lng
inet
Then lng
inet
conn = InternetConnect(lng
inet
, "219.131.192.243", 0, _ "administrator", "vai8888", 1, 0, 0) If lng
inet
conn Then blnRC = FtpPutFile(lng
inet
conn, "c:\1.txt", "/1.txt", 0, 0) If blnRC Then MsgBox "download ok!!!" End If InternetCloseHandle lng
inet
conn InternetCloseHandle lng
inet
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.
Inet
1.Execute Me.
Inet
1.URL, "send c:\11.txt /1.txt" '保存 End Sub Private Sub Command2_Click() Me.
Inet
1.Execute Me.
Inet
1.URL, "get /2.txt c:\2.txt" '下载 End Sub
vb链接FTP|推荐代码
vb链接FTP喜欢VB的朋友,相信它肯定可以提高编码的效率! 目录 译者序
控件
1,453
社区成员
41,355
社区内容
发帖
与我相关
我的任务
控件
VB 控件
复制链接
扫一扫
分享
社区描述
VB 控件
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章