易截截图软件、单文件、免安装、纯绿色、仅160KB

VB FTP上传和下载模块

Option Explicit
Private Const INTERNET_OPEN_TYPE_DIRECT = 1
Private Const scuseragent = "vb wininet"
Private Const INTERNET_FLAG_PASSIVE = &H8000000
'调用设置环境
Private 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
'连接服务器
Private 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
'上传涵数
Private 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
Private 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
Private Declare Function InternetCloseHandle Lib "wininet.dll" (ByVal hInet As Long) As Integer
Dim hOpen As Long
Dim hConnection As Long
'上传文件模块
Public Function UpLoadFile(IP As String, FileName As String, UserName As String, PassWord As String) As Boolean
Dim ShortName As String
Dim ret As Boolean
ShortName = GetShortName(FileName)
hOpen = TestServer
If hOpen <> 0 Then
hConnection = InterConnection(IP, UserName, PassWord)
If hConnection <> 0 Then
ret = FtpPutFile(hConnection, FileName, ShortName, 2, 0)
UpLoadFile = ret
Else
UpLoadFile = False
End If
Else
UpLoadFile = False
End If
InternetCloseHandle hConn


相关文档:

VB 5·1第三天

1、大道至简
 
米老师先呈现了一个函数的图像,然后问问大家想到了什么。
看到这张图,我先发现这是一个周期函数,再往深了就感觉自己应该不会了,寄希望于书信的几个同学,感觉应该是高数里的东西。但事实证明是初中的知识:
他是以下三个函数的复合函数:
y=sin(x)+sin(2x)+sin(3x)
 
 
 
& ......

VB截获Windows消息的钩子

本文引自。感谢原创!http://useway.blog.51cto.com/736087/176913
VB无所不能之三:VB截获Windows消息的钩子
——作者:钟声
博客地址:http://useway.blog.51cto.com
 
    VB一直被认为是一个可以通过简单的方法,完成Windows界面应用程序的一个语言。对Windows系统方面的编程似乎首 ......

pb調用VB寫的DLL方法

1、先把VB编译好的DLL文件放到系统的SYSTEM32文件夹下
2、用regsvr32注册这个DLL文件
3、Pb下调用
oleobject   ole_1
ole_1=create   oleobject
long   ll_ret
ll_ret=ole_1.connecttonewobject( 'add.addstring ')//其中add为VB的工程名,addstring为VB的类模块名
string   ls_message, ......

VB调用VC DLL 约定错误,求高手指点

VC函数是:extern "C" int __declspec(dllexport)PassPortRead(char *InPutData,char OuPutData[255]);
VB声明是:Private Declare Function PassPortRead Lib "PPRead.dll" (ByVal InPutData As String, ByVal OutPutData As String) As Integer
生成的文件能正常运行,并且能生成相应数据,但是在调试时提示"DLL调用约定错 ......

在vb中使用Iphlpapi.dll获取网络信息 第五章 结束语

※==================================================================
※本连载文章说明:
※1、连载首发于《软件报》(http://www.sweek.com)2006年21期(2006年5月22日);
※2、此次网上连载采用的是原稿件结构,内容与《软件报》发表略有不同;
※3、谢绝除《软件报》及其相关刊物之外的传统媒体部分或全部转载 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号