使用VB6的inet控件,超时后采集不到网页数据

使用VB6的inet控件,超时后采集不到网页数据,第1张

3.60 icePub_openUrl

l 函数原型

int WINAPI icePub_openUrl(char *currentUrlString,char *strHtmlText,int textMaxLen,char *strProxy)

输入:currentUrlString http地址

textMaxLen strHtmlText的最大长度

strProxy 代理服务器地址

输出:strHtmlText 返回的页面代码

l VC连接Lib方式声明

__declspec(dllexport)

int WINAPI icePub_openUrl(char *currentUrlString,char *strHtmlText,int textMaxLen,char *strProxy)

l 动态调用例程

VC sample代码:

char buff[1024*20+1]

typedef int (WINAPI ICEPUB_OPENURL)(char *currentUrlString,char *strHtmlText,int textMaxLen,char *strProxy)

ICEPUB_OPENURL *icePub_openUrl = 0

HINSTANCE hDLLDrv = LoadLibrary("icePubDll.dll")

if(hDLLDrv)

{

icePub_openUrl =(ICEPUB_OPENURL *)GetProcAddress(hDLLDrv,"icePub_openUrl")

}

if(icePub_openUrl)

{

icePub_openUrl("http://www.baidu.com",buff,1024*20,"")

}

if(hDLLDrv)

FreeLibrary(hDLLDrv)

AfxMessageBox(buff)

VB sample 代码:

Private Declare Function icePub_openUrl Lib "icePubDll.dll" (ByVal currentUrlString As String, ByVal strHtmlText As String, ByVal TextMaxLen As Integer) As Integer

Dim a2 As Integer

a2=icePub_openUrl("http://www.baidu.com",buff,1024*20,"")

. icePub_openUrll函数原型:intWINAPIicePub_openUrl(char*currentUrlString,char*strHtmlText,inttextMaxLen,char*strProxy)输入:currentUrlStringhttp地址textMaxLenstrHtmlText的最大长度strProxy代理服务器地址输出:strHtmlText返回的页面代码lVC连接Lib方式声明__declspec(dllexport)intWINAPIicePub_openUrl(char*currentUrlString,char*strHtmlText,inttextMaxLen,char*strProxy)l动态调用例程VCsample代码:charbuff[* + ]typedefint(WINAPIICEPUB_OPENURL)(char*currentUrlString,char*strHtmlText,inttextMaxLen,char*strProxy)ICEPUB_OPENURL*icePub_openUrl= HINSTANCEhDLLDrv=LoadLibrary("icePubDll.dll")if(hDLLDrv){icePub_openUrl=(ICEPUB_OPENURL*)GetProcAddress(hDLLDrv,"icePub_openUrl")}if(icePub_openUrl){icePub_openUrl("",buff,* ,"")}if(hDLLDrv)FreeLibrary(hDLLDrv)AfxMessageBox(buff)VBsample代码:PrivateDeclareFunctionicePub_openUrlLib"icePubDll.dll"(ByValcurrentUrlStringAsString,ByValstrHtmlTextAsString,ByValTextMaxLenAsInteger)AsIntegerDima AsIntegera =icePub_openUrl("",buff,* ,"")


欢迎分享,转载请注明来源:夏雨云

原文地址:https://www.xiayuyun.com/zonghe/392079.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-05-18
下一篇2023-05-18

发表评论

登录后才能评论

评论列表(0条)

    保存