就是用vb 6 模拟post方式提交数据到index.asp上面,有三个参数:id,title,content

解决方案 »

  1.   

    Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" ( _
        ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long    Dim Result As Long
        Result = ShellExecute(0, vbNullString, "http://www.baidu.com/", vbNullString, vbNullString, 3)
        If Result <= 32 Then
            MsgBox "调用浏览器错误!", vbOKOnly + vbCritical, "错误:"
        End If地址中的三个参数可以自己凑上去 "http://……/ id= " & yourID & "title=" & yourtitle ……
      

  2.   

    Public Const POST_URL = "http://xxxx/dianre/post.php"Public Const HEADER = "Content-Type: application/x-www-form-urlencoded" & vbCrLfPublic dataSend As String
    Public dataRecv As String
    Sub setSendData(user As String, cash As String)
        dataSend = ""
        dataSend = "Something"
        dataSend = "data=" & URLEncode(dataSend)
    End SubFunction postData()
        dataRecv = ""
        With frmMain
            .inet.RequestTimeout = 30
            .inet.AccessType = icDirect
            .inet.URL = POST_URL
            .inet.Execute , "POST", dataSend, HEADER
        End With
    End FunctionFunction URLEncode(strInput As String)
        strReturn = ""
        Dim i
        For i = 1 To Len(strInput)
            ThisChr = Mid(strInput, i, 1)
            If Abs(Asc(ThisChr)) < &HFF Then
                strReturn = strReturn & ThisChr
            Else
                innerCode = Asc(ThisChr)
                If innerCode < 0 Then
                    innerCode = innerCode + &H10000
                End If
                Hight8 = (innerCode And &HFF00) \ &HFF
                Low8 = innerCode And &HFF
                strReturn = strReturn & "%" & Hex(Hight8) & "%" & Hex(Low8)
            End If
        Next
        strReturn = Replace(strReturn, Chr(32), "%20")
        URLEncode = strReturn
    End FunctionSub Inet_StateChanged(ByVal State As Integer)
        Select Case State
        Case 1
            cmd.Caption = "Resolving host ..."
        Case 3
            cmd.Caption = "Connecting ..."
        Case 5
            cmd.Caption = "Sending data ..."
        Case 7
            cmd.Caption = "Receiving data ..."
        Case 11 'Error
            dataRecv = "Error occurred!" & vbCrLf & frmMain.inet.ResponseCode & ":" & frmMain.inet.ResponseInfo
            transactionDone
        Case 12 'Response completed
            cmd.Caption = "Getting data..."
            Dim vtData As Variant
            Dim Done As Boolean
            Done = False
            DoEvents
            Do While Not Done
                vtData = frmMain.inet.GetChunk(2048, icString)
                dataRecv = dataRecv & vtData
                DoEvents
                If Len(vtData) = 0 Then
                    Done = True
                End If
            Loop
            transactionDone True
        End Select
    End SubSub transactionDone(Optional clear As Boolean)
        frmMain.txtDataRecv.Text = dataRecv
        cmd.Enabled = True
        cmd.Caption = "Submit(&S)"
        If clear Then
            user.Text = ""
            cash.Text = ""
            user.SetFocus
        End If
    End Sub
      

  3.   

    用Webbrowser控件的方法:   
      怎么编程把用户名,密码提交到网页上的登录页?   
      首先在程序中加入Webbrowser控件并加入引用   Microsoft   HTML   Object   Library。   
      假设你的HTML页面表单代码如下:   
      <form   method="POST"   action="http://chen/dll/chat/chatmain.exe/RegUser">   
            
      请填写下面表单注册(*项为必添项)   
        
            
      *姓名<input   type="text"   name="Name"   size="20">   
        
            
      *昵称<input   type="text"   name="NickName"   size="20">   
        
            
      电子邮件<input   type="text"   name="EMail"   size="20">   
        
            
      *密码<input   type="text"   name="Password"   size="20">   
        
            
      <input   type="submit"   value="提交"   name="B1"><input   type="reset"   value="全部重写"   name="B2">   
        
      </form>   
      注意其中元素的type、Name、value属性。然后VB中的代码如下:   
      Private   Sub   Command1_Click()   
              WebBrowser1.Navigate   "http://chen/chat/newuser.htm"   
      End   Sub   
        
      Private   Sub   WebBrowser1_DocumentComplete(ByVal   pDisp   As   Object,   URL   As   Variant)   
              Dim   vDoc,   vTag   
              Dim   i   As   Integer   
                    
              Set   vDoc   =   WebBrowser1.Document   
              List1.Clear   
              For   i   =   0   To   vDoc.All.length   -   1   
                      If   UCase(vDoc.All(i).tagName)   =   "INPUT"   Then   
                              Set   vTag   =   vDoc.All(i)   
                              If   vTag.Type   =   "text"   Or   vTag.Type   =   "password"   Then   
                                      List1.AddItem   vTag.Name   
                                      Select   Case   vTag.Name   
                                              Case   "Name"   
                                                      vTag.Value   =   "IMGod"   
                                              Case   "NickName"   
                                                      vTag.Value   =   "IMGod"   
                                              Case   "Password"   
                                                      vTag.Value   =   "IMGodpass"   
                                              Case   "EMail"   
                                                      vTag.Value   =   "[email protected]"   
                                      End   Select   
                              ElseIf   vTag.Type   =   "submit"   Then   
                                      vTag.Click   
                              End   If   
                      End   If   
              Next   i   
      End   Sub   
      点击Command1就可以自动填表并提交了。   
        
      用MSXML的方法:   
      Option   Explicit   
      Dim   xml   As   New   XMLHTTP   
      Private   Sub   Command1_Click()   
            Call   AccessNet   
      End   Sub   
        
      Private   Sub   AccessNet()   
      On   Error   Resume   Next   
      Dim   str1   As   String   
      xml.open   "POST",   "http://yourWeb/handle.asp",   False   
        
      xml.setRequestHeader   "Content-Type",   "application/x-www-form-urlencoded"   
        
      xml.send   "UserName="   &   Text1.Text   &   "&Password="   &   Text2.text   
        
      If   xml.Status   =   200   Then   
            str1   =   StrConv(xml.responseBody,   vbUnicode)'返回的内容   
            MsgBox   str1   
      End   If   
      End   Sub   
      

  4.   

    摘自这里如何以Post方式向网页提交数据?
      

  5.   

    简单一点就是Private Sub Command1_Click()
    Inet1.Execute "http://localhost/test.aspx", "POST", "id=123&title=abc&content=efg", "Content-Type: application/x-www-form-urlencoded" & vbCrLf
    End Sub不过可能不能发中文,如果test.aspx用的是GB2312字符集应该没问题,如果是UTF-8字符集中文内容还得转成UTF-8编码。
      

  6.   

    哦,我的不是vb.net呢,是vb6呢有没Inet.execute的使用方法啊,我的vb6精简版老是提示Inet控制使用不了
      

  7.   

    去搜索下载一个MSINET.OCX放到程序同一目录
    再添加到VB的控件表里就可以了。
      

  8.   

    xmlhttp也成啊,inet winsock webbrowser这些都成不明白lz怎么就不成功呢??
      

  9.   

    说了那么多,都是废话,
    楼主的意思很明白,
    就是向网页POST数据,
    我正写这部分,POST成功了只是不知道怎么取返回值,
    把我的代码发给你.
    Private Sub Command1_Click()Dim strURL As String
    strURL = "http://202.102.152.100:8080/tz_test/signMakeAction.action?id=123444"
     Inet1.Execute strURL, "GET" End Sub这样就行了,你在页面接的时候随便写个后台就可以接到,
      

  10.   

    刚才优化了一下代码.
    贴给你.
    两种方法,POST  GET
    每种方法对应的后台接收是不一样的.
    我直接发到一个JSP上了.后台你自已改一下就行了.Private Sub Command1_Click()Dim strURL As StringstrURL = "http://202.102.152.100:8080/tz_test/signMakeAction.action?id=123444"
     Inet1.Execute strURL, "GET"
     While Inet1.StillExecuting
          DoEvents
      Wend
      Debug.Print StrZ
    End Sub
    Private Sub Command2_Click()
    Inet1.AccessType = icUseDefault
            Inet1.Execute "http://202.102.152.100:8080/tz_test/signMakeAction.action", "POST", "Id=123141", "Content-Type:   application/x-www-form-urlencoded "
            Do While Inet1.StillExecuting
                    DoEvents
            LoopEnd SubPrivate Sub Inet1_StateChanged(ByVal State As Integer)
    Select Case State
          Case 9
            StrInfo = Inet1.GetChunk(1024)
            While StrInfo <> ""
                StrZ = StrZ + StrInfo
                StrInfo = Inet1.GetChunk(1024)
            Wend
          Case 11
            MsgBox "未返回结果"
      End SelectEnd Sub
      

  11.   

    全用API写啊.我发过一贴子的.
      

  12.   

    abcfei,你的是get方式提交,如果换成post方式怎么写啊?
      

  13.   

    晕,我要自已弄程序哇,AutoHotKey有啥用?没用的
      

  14.   

    谢谢大家,现在可以好,我的代码如下:Private Sub Command1_Click()
      Dim myurl As String, send_data As String, my_head As String
      myurl = "http://localhost/index.aspx"
      send_data = "body=" + Trim(Text1.Text)
      my_head = "Content-Type: application/x-www-form-urlencoded"
      Inet1.Execute myurl, "POST", send_data, my_head
    End SubPrivate Sub Command2_Click()
      Text1.Text = ""
    End Sub
    Private Sub Form_Load()
    End Sub
    可是又碰见一个问题,希望高手解决一下,我模拟post发送的是html数据,如果文件中存在&号,数据会被自动截断,请问各位大侠如何处理?
      

  15.   

    或者有没其它的,可以批量发送,稍大数据量,快送有效的方法 PS:我是想把本地的一些HTML文章发布到服务器数据库里面去...
      

  16.   

    使用XML3.0的ServerHTTP。
    xmlhttp.open "post", "http:/xxx.com/index.asp", false
    xmlhttp.send "id=xxx&title=xxx&content=xxx"
      

  17.   

    你如果问的是&连接符号的问题,解决方案是把&转义成urlencode这个vb6里面我没使用过这个技巧我查一下http://www.china-askpro.com/msg29/qa83.shtml转义了,在asp接收的时候也能是正确的。这样就可以保证正确性了
      

  18.   

    Function RequestPage(ByVal Methord As String, ByVal Url As String, ByVal SendData As String, Optional ByVal RequestHeader As Dictionary, Optional ByVal ReturnType As String = "ResponseBody", Optional ByVal IsObj As Boolean = False, Optional ByVal IsAsync As Boolean = False) As Variant
        Dim XmlHttp As New MSXML2.ServerXMLHTTP
        Dim i As Integer
        With XmlHttp
            .setTimeouts 20000, 20000, 20000, 20000
            .open Methord, Url, IsAsync
            If Not RequestHeader Is Nothing Then
                For i = 0 To RequestHeader.Count - 1
                .setRequestHeader RequestHeader.Keys(i), RequestHeader.Items(i)
                Next
            End If
            On Error Resume Next
            .send SendData
            If Err Then
                If .readyState = 1 Then
                    Debug.Print "请求超时:" & Url
                    RequestPage = ""
                    Exit Function
                End If
            End If
        End With    If IsObj Then
            Set RequestPage = CallByName(XmlHttp, ReturnType, VbGet)
        Else
            RequestPage = CallByName(XmlHttp, ReturnType, VbGet)
        End If
    End FunctionFunction HTMLEncode(ByVal Text As String) As String
        Dim i As Integer
        Dim acode As Integer
        Dim repl As String    HTMLEncode = Text    For i = Len(HTMLEncode) To 1 Step -1
            acode = Asc(Mid$(HTMLEncode, i, 1))
            Select Case acode
                Case 32
                    repl = "&nbsp;"
                Case 34
                    repl = "&quot;"
                Case 38
                    repl = "&amp;"
                Case 60
                    repl = "&lt;"
                Case 62
                    repl = "&gt;"
                Case 32 To 127
                    ' don't touch alphanumeric chars
                Case Else
                    repl = "&#" & CStr(acode) & ";"
            End Select
            If Len(repl) Then
                HTMLEncode = Left$(HTMLEncode, i - 1) & repl & Mid$(HTMLEncode, _
                    i + 1)
                repl = ""
            End If
        Next
    End Function
        Dim Header As New Dictionary
        Header.Add "Content-Type", "application/x-www-form-urlencoded"
        Dim RetText As String
        RetText = RequestPage("POST", LoginUrl, "username=" & User & "&password=" & Pwd & "&submit=登录&mode=soft", Header, "ResponseText")
      

  19.   

    Function RequestPage(ByVal Methord As String, ByVal Url As String, ByVal SendData As String, Optional ByVal RequestHeader As Dictionary, Optional ByVal ReturnType As String = "ResponseBody", Optional ByVal IsObj As Boolean = False, Optional ByVal IsAsync As Boolean = False) As Variant 
    其中Methord为POST或GET,SendData可能为空,RequestHeader可以为nothing,ReturnType是为了获取不同的返回对象,比如xmlStream,ResponseText,ResponseBody等,IsObj是指定返回类型是否为对象类型,最后一个参数指定是否异步调用。
      

  20.   


    老大,用了你上面给的urlencode函数,在asp页面中,获取数据,中文全部乱码啊
      

  21.   

    asp 里用Server.UrlDecode接收 
      

  22.   

    呵呵,asp不支持server.urldecode吧?对象不支持此属性或方法: 'Server.urldecode' /index.asp,行 41 
      

  23.   

    VB发送代码如下:
    Private Sub Command1_Click()
      Dim myurl As String, send_data As String, my_head As String
      myurl = "http://localhost/index.asp"
      send_data = "body=" + URLEncode(Text1.Text)
      my_head = "Content-Type: application/x-www-form-urlencoded"
      Inet1.Execute myurl, "POST", send_data, my_head
    End SubPrivate Sub Command2_Click()
      Text1.Text = ""
    End Sub
    Public Function URLEncode(strInput As String) As String
         Dim strOutput As String
         Dim intAscii As Integer
         Dim i As Integer
         For i = 1 To Len(strInput)
         intAscii = Asc(Mid(strInput, i, 1))
         If ((intAscii < 58) And (intAscii > 47)) Or _
         ((intAscii < 91) And (intAscii > 64)) Or _
         ((intAscii < 123) And (intAscii > 96)) Then
         strOutput = strOutput & Chr$(intAscii)
         Else
         strOutput = strOutput & _
         IIf(intAscii < 16, "%0", "%") & _
         Trim$(Hex$(intAscii))
         End If
         Next
         URLEncode = strOutput
    End Function
    asp 接收代码如下:
    Function urldecode(encodestr) 
    newstr="" 
    havechar=false 
    lastchar="" 
    for i=1 to len(encodestr) 
    char_c=mid(encodestr,i,1) 
    if char_c="+" then 
    newstr=newstr & " " 
    elseif char_c="%" then 
    next_1_c=mid(encodestr,i+1,2) 
    next_1_num=cint("&H" & next_1_c) 
    if havechar then 
    havechar=false 
    newstr=newstr & chr(cint("&H" & lastchar & next_1_c)) 
    else 
    if abs(next_1_num)<=127 then 
    newstr=newstr & chr(next_1_num) 
    else 
    havechar=true 
    lastchar=next_1_c 
    end if 
    end if 
    i=i+2 
    else 
    newstr=newstr & char_c 
    end if 
    next 
    urldecode=newstr 
    End Function
    If request("body")<>"" then
        Dim Fsooo,Wss
    Set Fsooo=Server.CreateObject("Scripting.FileSystemObject")
    If (Fsooo.FileExists(server.mappath("/1.txt"))) Then 
    Set Files = Fsooo.GetFile(server.mappath("/1.txt")) 
      Files.Delete(True) 
    End If
        Set Wss=Fsooo.CreateTextFile(Server.mappath("/1.txt"),true)
      Wss.write request("body")&vbcrlf
      Wss.write Now()
      Wss.close
    Set Files=Nothing:Set Wss=nothing:Set Fsooo=nothing
    End If
      

  24.   

    http://www.souzz.net/html/edu/asp/asp2/12038.html不好意思...decode....函数需要自己写
      

  25.   

    发送的测试数据:
    <!--STATUS OK--><html><head>
    <meta http-equiv="content-type" content="text/html;charset=gb2312">
    <title>百度搜索_中国      </title>
    </head>
    <body link="#261cdc">
    <div class="Tit">
    <a href="http://news.baidu.com/ns?cl=2&rn=20&tn=news&word=%D6%D0%B9%FA"  onmousedown="return c({'fm':'tab','tab':'news'})">新闻</a>&nbsp;&nbsp;&nbsp;<span class="fB">网页</span>&nbsp;&nbsp;&nbsp;<a href="http://tieba.baidu.com/f?kw=%D6%D0%B9%FA"  onmousedown="return c({'fm':'tab','tab':'tieba'})">贴吧</a>&nbsp;&nbsp;&nbsp;<a href="http://zhidao.baidu.com/q?ct=17&pn=0&tn=ikaslist&rn=10&word=%D6%D0%B9%FA&fr=wwwt"  onmousedown="return c({'fm':'tab','tab':'zhidao'})">知道</a>&nbsp;&nbsp;&nbsp;<a href="http://mp3.baidu.com/m?tn=baidump3&ct=134217728&lm=-1&word=%D6%D0%B9%FA"  onmousedown="return c({'fm':'tab','tab':'mp3'})">MP3</a>&nbsp;&nbsp;&nbsp;<a href="http://image.baidu.com/i?tn=baiduimage&ct=201326592&lm=-1&cl=2&word=%D6%D0%B9%FA"  onmousedown="return c({'fm':'tab','tab':'pic'})">图片</a>&nbsp;&nbsp;&nbsp;<a href="http://video.baidu.com/v?ct=301989888&rn=20&pn=0&db=0&s=25&word=%D6%D0%B9%FA"  onmousedown="return c({'fm':'tab','tab':'video'})">视频</a>&nbsp;&nbsp;&nbsp;
    </div>
    <table cellspacing="0" cellpadding="0">
    <tr><td valign="top" nowrap><form name="f" action="s" >
    <input type="hidden" name="bs" value="中国">
    <input type="hidden" name="f" value="8">
    <input name="wd" id="kw" size="42" class="i" value="中国" maxlength="100"> 
    <input type="submit" value="百度一下"> <input type="button" value="结果中找" onclick="return bq(document.forms[0]);">&nbsp;&nbsp;&nbsp;
    </form></td>
    <td valign="middle" nowrap>
    <a href="http://www.baidu.com/gaoji/preferences.html">设置</a>&nbsp;|&nbsp;<a href="http://www.baidu.com/gaoji/advanced.html">高级搜索</a>
    </td></tr></table>
    </td>
    <td></td>
    </tr></table>
    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="bi">
    <tr>
    <td nowrap>&nbsp;&nbsp;&nbsp;<a onClick="h(this,'http://www.baidu.com');hc('baidu')" href="#" style="color:#000000 ">把百度设为主页</a></td>
    <td align="right" nowrap>百度一下,找到相关网页约100,000,000篇,用时0.001秒&nbsp;&nbsp;&nbsp;&nbsp;</td>
    </tr>
    </table>
    <table width="30%" border="0" cellpadding="0" cellspacing="0" align="right"><tr>
    <td align="left" style="padding-right:10px">
    <div style="border-left:1px solid #e1e1e1;padding-left:10px;word-break:break-all;word-wrap:break-word;">
    <div id="ec_im_container"><div class="r" id="bdfs0">
    <a id=dfs0 href="http://www.baidu.com/baidu.php?url=-ZcK00j-3ZXqqtHjP8u0nUldWhnXJdgSUk69pJKx88iZBkKXiW3kgw_fpxyu3DNFMMNQayNYeimwpssX3xmyE5sG4APdS1y8veBzP3YjuIqrJDWK5lefAnMfac6x.7R_j9qBm3YkfG9GRojPak8LUOZBC.U1Yk0ZDqdVa4S6KY5IUf8xoiSPjf8TMA_fKGUHYznjD0I1Y0u1dBUW010APzm1Y1P16sn0" target="_blank" onMouseOver="return ss('链接至 www.zqessencec.com.cn')" onMouseOut="cs()">
    <font size="3">今日焦点:3只暴涨短线黑马股</font>
    </a><br>
    <a href="http://www.baidu.com/baidu.php?url=-ZcK00j-3ZXqqtHjP8u0nUldWhnXJdgSUk69pJKx88iZBkKXiW3kgw_fpxyu3DNFMMNQayNYeimwpssX3xmyE5sG4APdS1y8veBzP3YjuIqrJDWK5lefAnMfac6x.7R_j9qBm3YkfG9GRojPak8LUOZBC.U1Yk0ZDqdVa4S6KY5IUf8xoiSPjf8TMA_fKGUHYznjD0I1Y0u1dBUW010APzm1Y1P16sn0" target="_blank" id="bdfs0" style="text-decoration:none;"><font size="-1" color="#000000">经证监会审核批准首批股票咨询资格,<br>著名权威专家全程跟踪提供股票查询,</font><br><font size="-1" color="#008000">www.zqessencec.com.cn</font></a>
    </div><br><div class="r" id="bdfs1">
    <a id=dfs1 href="http://www.baidu.com/baidu.php?url=-ZcK000Ic9_V4x5d5b45Iy-tli6bYzTK_ETJ0ui9SVWD-ymW1jHCgLI8C0rqbWC8ahAzQLgEhI5Lb6MKle3xuOsVA-9uSiYNLDQO8xV-b-j0EyREZynk5GDrwcHK.Db_jVzlqNgUJLUrwi_nYQAHGLIM7f0.U1Yz0ZDqdVa4S6KY5Uve1pWiSPjf0A-V5HcsnfKL5fKM5yF8njn0mLFW5HRLrj0" target="_blank" onMouseOver="return ss('链接至 www.kjfghkg58.cn')" onMouseOut="cs()">
    <font size="3">股票行情软件免费下载试用</font>
    </a><br>
    <a href="http://www.baidu.com/baidu.php?url=-ZcK000Ic9_V4x5d5b45Iy-tli6bYzTK_ETJ0ui9SVWD-ymW1jHCgLI8C0rqbWC8ahAzQLgEhI5Lb6MKle3xuOsVA-9uSiYNLDQO8xV-b-j0EyREZynk5GDrwcHK.Db_jVzlqNgUJLUrwi_nYQAHGLIM7f0.U1Yz0ZDqdVa4S6KY5Uve1pWiSPjf0A-V5HcsnfKL5fKM5yF8njn0mLFW5HRLrj0" target="_blank" id="bdfs1" style="text-decoration:none;"><font size="-1" color="#000000">大盘黑马股票最新研发,炒股必备<br>更多股票大盘走势图请请登录咨询</font><br><font size="-1" color="#008000">www.kjfghkg58.cn</font></a>
    </div><br><div class="r" id="bdfs2">
    <a id=dfs2 href="http://www.baidu.com/baidu.php?url=-ZcK00jBOCWfqbns3KZ9NOcA4oScwBqg3YsnWOpFkYaQOpj9pPd1ROwiiJZL4ittWd3GLzOHIIBLrLpjeKIEdZLaZyxlfkUAZSUdr9IUsEn4-qllOt-ltPE3Q02V.7Y_jGzNtX2cPB-muCy2SM_LI26.U1Y10ZDqdVa4S6KY5IUf8xoiSPjf8TMA_fKGUHYznjD0I1Y0u1dBUW010APzm1YYrHDYnf" target="_blank" onMouseOver="return ss('链接至 www.62133.com/8')" onMouseOut="cs()">
    <font size="3">黑马短线股强力出击100%获利</font>
    </a><br>
    <a href="http://www.baidu.com/baidu.php?url=-ZcK00jBOCWfqbns3KZ9NOcA4oScwBqg3YsnWOpFkYaQOpj9pPd1ROwiiJZL4ittWd3GLzOHIIBLrLpjeKIEdZLaZyxlfkUAZSUdr9IUsEn4-qllOt-ltPE3Q02V.7Y_jGzNtX2cPB-muCy2SM_LI26.U1Y10ZDqdVa4S6KY5IUf8xoiSPjf8TMA_fKGUHYznjD0I1Y0u1dBUW010APzm1YYrHDYnf" target="_blank" id="bdfs2" style="text-decoration:none;"><font size="-1" color="#000000">提供股票培训,专业分析行情!<br>股票行情,股市行情理财权威分析.</font><br><font size="-1" color="#008000">www.62133.com/8</font></a>
    </div><br><div class="r" id="bdfs3">
    <a id=dfs3 href="http://www.baidu.com/baidu.php?url=-ZcK000s-HFwXt7mkNH0lsZKocPNyG622wZiaIQmu1MgYr8OIQ_wqQIhkFrW8WyHnInf1LhjSfKXavtSjOkoNu_r95Ega9wYhLUMxHWi_zRDrTia0XpahIqxEKol.7R_ip_8Ou3eD2N9h9m3SrHW3J0.U1YY0ZDqdVa4S6KY5T5kzxoiSPjf0A-V5HcsnfKL5fKM5yF8njn0mLFW5HcsPH6v" target="_blank" onMouseOver="return ss('链接至 gj9878.com')" onMouseOut="cs()">
    <font size="3">特别关注:3只即将涨停股</font>
    <td nowrap><a href="http://www.baidu.com/search/jiqiao.html" target="_blank">帮助</a></td>
    </tr>
    </form>
    </table>
    <div id="ft">&copy;2009 Baidu <span>此内容系百度根据您的指令自动搜索的结果,不代表百度赞成被搜索网站的内容或立场</span></div>
    <img src="http://c.baidu.com/c.gif?t=0&q=%D6%D0%B9%FA&p=0&pn=1" style="display:none">
    </body>
    <script>c({'fm':'se','T':'1259033078','y':'FF767A2A'});if(navigator.cookieEnabled && !/sug?=0/.test(document.cookie)){document.write('<script src=http://www.baidu.com/js/bdsug.js?v=1.1.0.3><\/script>')};window.onunload=function(){};window.onload=function(){document.forms[0].reset();}</script>
    </html><!--b48afb3b4925cf44-->
      

  26.   

    http://www.pconline.com.cn/pcedu/empolder/wz/asp/0401/269526.html网上有不少现成的方案....
      

  27.   

    用了urldecode还是一样,没用?
    比如中文中华人民共和国,输出以后就是:6D0 9FA 8CB 3F1 9B2 ACD 9FA
      

  28.   

    那用htmlencode htmldecode方案好了...楼上的同学写了htmlencode的方案htmldecode Function HTMLDecode(sText)
        Dim I
        sText = Replace(sText, "&quot;", Chr(34))
        sText = Replace(sText, "&lt;"  , Chr(60))
        sText = Replace(sText, "&gt;"  , Chr(62))
        sText = Replace(sText, "&amp;" , Chr(38))
        sText = Replace(sText, "&nbsp;", Chr(32))
        For I = 1 to 255
            sText = Replace(sText, "&#" & I & ";", Chr(I))
        Next
        HTMLDecode = sText
    End Function
      

  29.   

    Private Sub Command1_Click()
      Dim myurl As String, send_data As String, my_head As String
      myurl = "http://localhost/index.asp"
      send_data = "body=" + URLEncode(Text1.Text)
      my_head = "Content-Type: application/x-www-form-urlencoded"
      Inet1.Execute myurl, "POST", send_data, my_head
    End SubPrivate Sub Command2_Click()
      Text1.Text = ""
    End Sub
    Public Function URLEncode(strInput As String) As String
         Dim strOutput As String
         Dim intAscii As Integer
         Dim i As Integer
         For i = 1 To Len(strInput)
         intAscii = Asc(Mid(strInput, i, 1))
         If ((intAscii < 58) And (intAscii > 47)) Or _
         ((intAscii < 91) And (intAscii > 64)) Or _
         ((intAscii < 123) And (intAscii > 96)) Then
         strOutput = strOutput & Chr$(intAscii)
         Else
         strOutput = strOutput & _
         IIf(intAscii < 16, "%0", "%") & _
         Trim$(Hex$(intAscii))
         End If
         Next
         URLEncode = strOutput
    End FunctionPublic Function URLEncode(strInput As String) As String
         Dim strOutput As String
         Dim intAscii As Integer
         Dim i As Integer
         For i = 1 To Len(strInput)
         intAscii = Asc(Mid(strInput, i, 1))
         If ((intAscii < 58) And (intAscii > 47)) Or _
         ((intAscii < 91) And (intAscii > 64)) Or _
         ((intAscii < 123) And (intAscii > 96)) Then
         strOutput = strOutput & Chr$(intAscii)
         Else
         strOutput = strOutput & _
         IIf(intAscii < 16, "%0", "%") & _
         Trim$(Hex$(intAscii))
         End If
         Next
         URLEncode = strOutput
    End Function如果不用URLEncode就没问题,用了中文就显示乱码