试试把程序改为
……
Inet1.URL="ftp://somesite.cn"
Inet1.Execute ,  "DIR"
……

解决方案 »

  1.   

    不是用户名或密码无效,你可以将你的inet1.Execute语句改写为以下形式:
    Inet1.Execute "ftp://" + FtpUserName & ":" & FtpPassword & "@" & FtpServerName,"DIR"
    其中ftpusername为inet1.username,ftppassword为inet1.password,ftpservername为inet1.remotehost,通过这种形式才能对用户名和密码验证,否则只能是匿名登录了,如果你事先已经用代码设置了一下属性
    inet1.remotehost="*****"
    inet1.username="******"
    iner1.password="*****"
    inet1.remoteport="21"
    则你也可以采用这种形式:Inet1.Execute ,"DIR"-----------------------------
    关于你的inet1.username为何为空你的问题,我想可能是一下语句的问题:
    While Inet1.StillExecuting
    DoEvents
    Wend 
    你把这段语句去掉就可以了,或者只使用DoEvents就可以了
    --------------------
    希望能解决你的问题