用VB创建FTP组件(get)

来源:互联网 发布:怎样对付淘宝卖家骚扰 编辑:程序博客网 时间:2024/05/29 13:45

 Const INTERNET_FLAG_PASSIVE = &H8000000 ' used For FTP  connections
        Const PassiveConnection As Boolean = True

        Dim sProxyName As String = "Ftp=ftp://Proxy1:21?"

        Dim sProxyBypass As String = "ov*?"

        Dim sAgent As String = "FTP Control"

        Dim strServer As String, strUser As String, strPassword As String

        strServer = "177.188.0.100"

        strUser = "FTPUSER"

        strPassword = "200803"

        Dim lngINet As Integer = InternetOpen(sAgent, 1, sProxyName, sProxyBypass, 0)

        Dim lngINetConn As Integer = InternetConnect(lngINet, strServer, 0, strUser, strPassword, 1, IIf(PassiveConnection, INTERNET_FLAG_PASSIVE, 0), 0)

        Dim blnRC As Boolean = FtpGetFile(lngINetConn, "dirmap.txt", "c:/dirmap.txt", 0, 0, 2, 0) 

 

出现下面问题应该怎么解决:

A call to PInvoke function 'WindowsApplication1!WindowsApplication1.Form1::InternetOpen' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.