我用INET控件写了一个FTP下载,请用如何用这个控件得到FTP空间里某一个文件的大小?同样,我如何得到我本地硬盘中的某的文件的大小?谢谢!

解决方案 »

  1.   

    Inet1.Execute "ftp://kk:[email protected]"
    Label2.Caption = FileLen("dd.rar")楼上的朋友,是这样的吗?
      

  2.   

    Inet1.Execute , "size wq.rar"
    filesize = Inet1.GetChunk(1024,0)
    MsgBox CStr(filesize)
      

  3.   

    Private Sub Command1_Click()
    Inet1.Execute "ftp://jj:[email protected],33.344", "size wq.rar"
    filesize = Inet1.GetChunk(1024, 0)
    MsgBox CStr(filesize)
    End Sub这种格式报错。
      

  4.   

    Dim filesize As Long
    Private Sub Command1_Click()
      Inet1.Execute , "size sss.txt"
    End SubPrivate Sub Command2_Click()
    Inet1.Execute , "size MSDN.rar"
    End SubPrivate Sub Form_Load()
      Dim StrMsg As String
      Dim isbusy As Boolean
      Inet1.URL = "ftp://vision.vssky.org/"
      Inet1.Protocol = icFTP
      Inet1.UserName = "visionspace"
      Inet1.Password = "visionspace"
    End SubPrivate Sub Inet1_StateChanged(ByVal State As Integer)
    If State = 12 Then
        filesize = Inet1.GetChunk(1024, 0)
        MsgBox CStr(filesize)
    End If
    End Sub
    这种 方法,完全可以...我试过的.另外,不知道如何监视远程FTP上的大小就是了.比如,我正在上传.我一直的要知道.上传了多少了.
      

  5.   

    try:
    Private Sub Command1_Click()
    Inet1.Execute "ftp://jj:[email protected],33.344", "size wq.rar"
    Do While Inet1.StillExecuting
        DoEvents
    Loop
    filesize = Inet1.GetChunk(1024, 0)
    MsgBox CStr(filesize)
    End Sub