佳礼资讯网

 找回密码
 注册

ADVERTISEMENT

查看: 954|回复: 0

vb ftp error...

[复制链接]
发表于 23-12-2009 02:44 PM | 显示全部楼层 |阅读模式
本帖最后由 qwe88 于 23-12-2009 02:47 PM 编辑

我在尝试用vb connect 去自己的ftpcode 如下:

  1. Public Class Form1
  2.     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
  3.     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
  4.     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
  5.     Private Declare Function InternetCloseHandle _    Lib "wininet.dll" (ByVal hInet As Long) As Integer

  6.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load        Dim lngINet& = InternetOpen("MyFTP Control", 1, vbNullString, vbNullString, 0)        Dim lngINetConn& = InternetConnect(lngINet, "localhost", 21, "chitak", "nasilemak", 1, 0, 0)    End SubEnd Class
复制代码





不过run过后有个很奇怪的error出现在在那段highlight的地方 :
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.


有那位大大可以告诉我那里做错吗?
谢谢~
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

 

ADVERTISEMENT



ADVERTISEMENT



ADVERTISEMENT

ADVERTISEMENT


版权所有 © 1996-2023 Cari Internet Sdn Bhd (483575-W)|IPSERVERONE 提供云主机|广告刊登|关于我们|私隐权|免控|投诉|联络|脸书|佳礼资讯网

GMT+8, 30-11-2025 06:37 PM , Processed in 0.158986 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表