可以用VB编写直接将本地的数据上传到WWW上一个指定的地址吗?又如何将WWW上存在的文件直接下载到本地制定的目录下?哪位有相关方面的经验或是相关方面的资料?

解决方案 »

  1.   

    上传需要服务器配合,下载可用API,查一下这个API的使用方法 URLDownloadToFile
      

  2.   

    用网页方面上传呀!!!  加参数传到,asp?pata.......
      

  3.   

    filecopy就可以在网络上的机子之间拷东西啊。可是服务器不给你权限你怎么拷东西到服务器的硬盘呢?你至少得得到服务器的用户名、密码。然后用VB写一个bat批处理文件,上面用net use命令获得服务器权限。格式是-----net use \\服务器名\路径 password  /user:username用VB的shell执行这个bat再用filecopy拷到服务器相应目录之下即可。
      

  4.   

    其实就是ftp程序阿可以用winsock做一个ftp客户端
      

  5.   

    我要上传的话肯定是知道了FTP的地址,还有用户名和密码的net use \\服务器名\路径 password  /user:username 这个格式如何实现?还有请问online(龙卷风(白学了,重新充电中)) 怎么做FTP程序呀,介绍一点相关资料,谢谢
      

  6.   

    用ftp控件 简单
    也可以有api
      

  7.   

    使用winsock控件
    Private Sub Command1_Click()
        Command1.Enabled = False
        Command2.Enabled = True
        While Winsock2.State <> sckConnected
            Timer2.Enabled = True
            DoEvents
        Wend
        Dim i As Integer
        LnFile = FileLen(srcFile)
        nLoop = 0    ReDim Buffer(maxByte)
        Open srcFile For Binary Access Read As #1
        
        Winsock1.SendData "SF"
        DoEvents
        Winsock1.SendData Text1.Text
        DoEvents
        serResponse = ""
        Do
            If CtrlCommand <> False Then
                Exit Do
            End If
            strMessage = "正在发送文件…"
            If (nLoop + maxByte + 1) < LnFile Then
                Get #1, , Buffer  '每次读 1024 个位元组
                Winsock1.SendData "SendDatas"
                DoEvents
                While serResponse <> "Ready"
                    DoEvents
                Wend
                serResponse = ""
                Winsock2.SendData Buffer
                DoEvents
                nLoop = nLoop + maxByte + 1
            Else
                nLoop = LnFile - nLoop - 1
                ReDim Buffer(nLoop)
                Get #1, , Buffer  '每次读 1024 个位元组
                Winsock1.SendData "SendDatas"
                DoEvents
                While serResponse <> "Ready"
                    DoEvents
                Wend
                serResponse = ""
                Winsock2.SendData Buffer
                DoEvents
                Exit Do
            End If
        Loop
        Close #1
        If CtrlCommand = False Then
            Winsock1.SendData "SendComplete"
            DoEvents
            strMessage = "文件发送完毕!"
            Command2.Enabled = False
        Else
            Winsock1.SendData "Cancel"
            DoEvents
            strMessage = "取消文件发送!"
            CtrlCommand = False
        End If
        Winsock2.Close
    End Sub
      

  8.   

    http://www.ourfly.com/download/downloadlist.aspx?type=VB
    vb网络编程从入门到精通源码 
    其中第十章的例子为ftp
      

  9.   

    winsock更需要服务器端程序,winsock使用的是TCP协议,与题中的所谓“WWW”(其实应该是HTTP协议,现在的网址已经不用WWW也可以)无关了。
    只要客户端与服务器端配合好,上传的方法很多,关键是“配合”
      

  10.   

    那个net命令如果有一台机子叫server或者它的IP是xxx.xxx.x.xx,用户名是admin,密码是111net use可以写成net use \\xxx.xxx.x.xx\相应路径 111  /user:admin
    或者net use \\server\相应路径 111  /user:admin在批处理中执行了以上命令,你就获得了向服务器直接filecopy的权利了。那个相应路径指的是服务器硬盘上的与网址对应的路径(你需要知道IIS的设置),而不是网址路径。这种方法在局域网的维护中更为常见。在互联网上,还要考虑到服务器防火墙设置的问题,要让它给你留个通道。这个法子,相比较ftp而言,简单些,不过有点不太正规。偶赞同楼上的意见,方法有很多,关键是“配合”。能用就行。