好像是少了点什么吧?我最近刚做过这个问题
inet1.execute txturl,text,"put" & " " & commondialog1.filename  _& " " & "/" & txtup.text
别忘了inet1.username="a"
     inet1.password="a"

解决方案 »

  1.   

    我的QQ无法给你发信息,可能有问题,我现在相知到如何用GET方法下载整个文件夹,而且如何让服务器端文件以浏览器样式显示在客户端中,单我不想用webbrowser 控件那样就太简单了谢谢你
      

  2.   

    1)
    使用Internet Transfer Control
    注意:
    在asp页面中,&和+等字符具有特殊的含义,因此不能在Internet Transfer控件中通过string类型的字符串直接传送,我觉得您的问题应该就是这个原因引起的。您可以试着用%后面加上2位16进制数字来替代相应的字符。
            Dim strURL As String, strFormData As String
            strURL = "http://webserver/generic.asp"
            strFormData="fname=randy%26lname=morgan"
            Inet1.Execute strURL, "Post", strFormData,  _
                           "Content-Type:  application/x-www-form-urlencoded"在%字符后面的是ASCII字符所对应的16进制数字。 %26即代表符号&参考以下ASCII码表来了解他们的对应关系:
    ASCII Character Codes Chart 1
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclang98/html/_pluslang_ascii_character_codes_chart_1.asp2)
    斑竹的控件:
    http://www.csdn.net/expert/topic/378/378264.shtm
      

  3.   

    目的:Upload  and  download  files  using  FTP 
    方法:Use  the  Internet  Transfer  Control.         Private  Sub  cmdUpload_Click() 
            Dim  host_name  As  String 
            
                    Enabled  =  False 
                    MousePointer  =  vbHourglass 
                    txtResults.Text  =  "Working" 
                    txtResults.SelStart  =  Len(txtResults.Text) 
                    DoEvents        
                    host_name  =  txtHost.Text 
                    If  LCase$(Left$(host_name,  6))  <>  "ftp://"  Then  host_name  =  "ftp://"  &  host_name 
                    inetFTP.URL  =  host_name 
            
                    inetFTP.UserName  =  txtUserName.Text 
                    inetFTP.Password  =  txtPassword.Text 
            
                    '  Do  not  include  the  host  name  here.  That  will  make 
                    '  the  control  try  to  use  its  default  user  name  and 
                    '  password  and  you'll  get  the  error  again. 
                    inetFTP.Execute  ,  "Put  "  &  _ 
                            txtLocalFile.Text  &  "  "  &  txtRemoteFile.Text 
            End  Sub 
    =================================================================== 
    代码(用msinet.ocx): 
    Private  m_GettingDir  As  Boolean 
    Private  Sub  AddMessage(ByVal  msg  As  String) 
            txtResults.Text  =  txtResults.Text  &  vbCrLf  &  msg 
            txtResults.SelStart  =  Len(txtResults.Text) 
    End  Sub Private  Sub  cmdDownload_Click() 
    Dim  host_name  As  String         Enabled  =  False 
            MousePointer  =  vbHourglass 
            txtResults.Text  =  "Working" 
            txtResults.SelStart  =  Len(txtResults.Text) 
            DoEvents 
            host_name  =  txtHost.Text 
            If  LCase$(Left$(host_name,  6))  <>  "ftp://"  Then  host_name  =  "ftp://"  &  host_name 
            inetFTP.URL  =  host_name         inetFTP.UserName  =  txtUserName.Text 
            inetFTP.Password  =  txtPassword.Text 
            inetFTP.Execute  ,  "Get  "  &  _ 
                    txtRemoteFile.Text  &  "  "  &  txtLocalFile.Text 
    End  Sub Private  Sub  cmdUpload_Click() 
    Dim  host_name  As  String         Enabled  =  False 
            MousePointer  =  vbHourglass 
            txtResults.Text  =  "Working" 
            txtResults.SelStart  =  Len(txtResults.Text) 
            DoEvents 
            host_name  =  txtHost.Text 
            If  LCase$(Left$(host_name,  6))  <>  "ftp://"  Then  host_name  =  "ftp://"  &  host_name 
            inetFTP.URL  =  host_name         inetFTP.UserName  =  txtUserName.Text 
            inetFTP.Password  =  txtPassword.Text 
            inetFTP.Execute  ,  "Put  "  &  _ 
                    txtLocalFile.Text  &  "  "  &  txtRemoteFile.Text End  Sub 
    Private  Sub  inetFTP_StateChanged(ByVal  State  As  Integer) 
            Select  Case  State 
                    Case  icError 
                            AddMessage  "Error:  "  &  _ 
                                    "        "  &  inetFTP.ResponseCode  &  vbCrLf  &  _ 
                                    "        "  &  inetFTP.ResponseInfo 
                    Case  icNone 
                            AddMessage  "None" 
                    Case  icConnecting 
                            AddMessage  "Connecting" 
                    Case  icConnected 
                            AddMessage  "Connected" 
                    Case  icDisconnecting 
                            AddMessage  "Disconnecting" 
                    Case  icDisconnected 
                            AddMessage  "Disconnected" 
                    Case  icRequestSent 
                            AddMessage  "Request  Sent" 
                    Case  icRequesting 
                            AddMessage  "Requesting" 
                    Case  icReceivingResponse 
                            AddMessage  "Receiving  Response" 
                    Case  icRequestSent 
                            AddMessage  "Request  Sent" 
                    Case  icResponseReceived 
                            AddMessage  "Response  Received" 
                    Case  icResolvingHost 
                            AddMessage  "Resolving  Host" 
                    Case  icHostResolved 
                            AddMessage  "Host  Resolved"                 Case  icResponseCompleted 
                            AddMessage  inetFTP.ResponseInfo                         If  m_GettingDir  Then 
                                    Dim  txt  As  String 
                                    Dim  chunk  As  Variant                                 m_GettingDir  =  False                                 '  Get  the  first  chunk. 
                                    chunk  =  inetFTP.GetChunk(1024,  icString) 
                                    DoEvents 
                                    Do  While  Len(chunk)  >  0 
                                            txt  =  txt  &  chunk 
                                            chunk  =  inetFTP.GetChunk(1024,  icString) 
                                            DoEvents 
                                    Loop                                 AddMessage  "----------" 
                                    AddMessage  txt 
                            End  If               Case  Else 
                            AddMessage  "State  =  "  &  Format$(State) 
            End  Select         Enabled  =  True 
            MousePointer  =  vbDefault 
    End  Sub