none
请问VB.NET中正确使用HttpSendRequestEx的方法? RRS feed

  • 问题

  • 我先是定义API参数为:

        Private Declare Function HttpSendRequestEx Lib "wininet.dll" Alias "HttpSendRequestExA" ( _
        ByVal hRequest As Long, _
        ByVal lpBuffersIn As Long, _
        ByVal lpBuffersOut As Long, _
        ByVal dwFlags As Long, _
        ByVal dwContext As Long) As Long

    结果不知道如何取得lpBuffersIn的地址。

    所以改为:

     Private Declare Function HttpSendRequestEx Lib "wininet.dll" Alias "HttpSendRequestExA" ( _
        ByVal hRequest As Long, _
        ByVal lpBuffersIn As INTERNET_BUFFERS, _
        ByVal lpBuffersOut As Long, _
        ByVal dwFlags As Long, _
        ByVal dwContext As Long) As Long

    INTERNET_BUFFERS为structure

    调用

    HttpSendRequestEx(open request获得的handle, 变量, 0&, 0&, 0&)

    运行返回false,lastdllerr=87,应该是参数错误吧?

    想询问这个API正确的调用方式是什么?谢谢

    2012年1月4日 3:07

答案