我以前都是用集成在Dreamweaver里的上传功能上传文件到远程服务器,请问用vb是否可实现类似的上传文件功能?不需要用户选文件上传,一次传一个文件即可。

解决方案 »

  1.   

    你要写c/s或b/s
    b/s用vb写个ocx
      

  2.   

    inet1.URL=ftp://username:password@hostname/document  
      inet1.Protocol=2-icFTP  
      inet1.RemoteHost=hostname  
      inet1.RemotePort=21  
      inet1.Username=username  
      inet1.Password=password  
    For each Item in oFolder.files
         curFile=oFolder.path & "\" & Item.name
         inet1.execute inet1.url, "put " & curFile & "/目标目录/目标文件名"
    Next 
      

  3.   

    其实就是ftp功能, 就如楼上所说的
      

  4.   

    to lxqlogo0:
    请问inet1是什么组件,如何引用?
      

  5.   

    vb自带的控件 为msinet.ocx
    在部件中添加就OK了
      

  6.   

    参考了前面的代码我写了以下语句,但运行到最后一句,出现了出错提示,请问原因?
    Dim curFile As String
    Inet1.URL = "ftp.gjlqjt.com"
    Inet1.Protocol = 2 - icFTP
    Inet1.RemoteHost = "www.gjlqjt.com"
    Inet1.RemotePort = 21
    Inet1.UserName = "aaa"
    Inet1.Password = "111"
    curFile = "e:\temp\abc.htm"
    Inet1.Execute Inet1.URL, "put " & curFile & " /www/abc.htm"出错提示:
    实时错误‘35753’
    协议不支持这种方法
      

  7.   


    协议更改一下 用缺省的或FTP均行 
    Inet1.Protocol = icFTP