zoukankan      html  css  js  c++  java
  • Proxy代理

     
    返回
    Proxy代理程序示例代码
    ASP示例代码
    <%@LANGUAGE="VBScript" CODEPAGE="936"%>
    <%
    Option Explicit

    Dim domain
    Dim keywords

    Dim xmlHttp
    Dim postData

    domain=Request("domain")
    keywords=Request("keywords")

    If domain="" OR keywords="" Then
        Response.End
    End If

    Set xmlHttp=Server.CreateObject("Microsoft.XMLHTTP")    'MSXML2.XMLHTTP
    postData = "ajaxaction=bqipd&u="&domain&"&q="+keywords
    xmlHttp.Open "POST","http://www.brandqq.com/AjaxPostResponse.aspx",false

    xmlHttp.SetRequestHeader "Content-Type","application/x-www-form-urlencoded"
    xmlHttp.Send(postData)

    Response.Charset="GB2312"
    Response.Write xmlHttp.responseText
    Response.End
    %>
    ASP.NET示例代码(c#)
    <%@ Page Language="C#" %>
    <%@ Import Namespace="System.Net" %>
    <%@ Import Namespace="System.IO" %>

    <script runat="server">
        void Page_Load(object s, EventArgs e)
        {
            if (Request["domain"] == null || Request["keywords"] == null)
            {
                return;
            }

            string domain = Request["domain"].Trim();
            string keywords = Request["keywords"].Trim();


            WebRequest request = WebRequest.Create("http://www.brandqq.com/AjaxPostResponse.aspx");
            request.Method = "POST";
            request.ContentType = "application/x-www-form-urlencoded";
           
            byte[] data = Encoding.UTF8.GetBytes("AjaxAction=bqipd&u=" + domain + "&q=" + keywords);

            Stream dataStream = request.GetRequestStream();
            dataStream.Write(data, 0, data.Length);
            dataStream.Close();
           

            WebResponse response = request.GetResponse();

            StreamReader reader = new StreamReader(response.GetResponseStream());
            string xml = reader.ReadToEnd();
            reader.Close();
           
            Response.ContentEncoding = Encoding.UTF8;
            Response.ContentType = "text/xml";
            Response.Write(xml);
            Response.End();
        }
    </script>

  • 相关阅读:
    Odoo 库存管理-库存移动(Stock Move)新玩法
    odoo8.0+PyCharm4.5开发环境配置
    (总结)隐藏PHP版本与PHP基本安全设置
    Docker无法启动 Could not find a free IP address range for interface 'docker0' 最方便的解决办法
    MySQL Point in Time Recovery the Right Way
    The query below helps you to locate tables without a primary key:
    记一次揪心的MySQL数据恢复过程
    Linux中利用extundelete恢复误删除的数据
    Centos升级Python 2.7并安装pip、ipython
    navicat
  • 原文地址:https://www.cnblogs.com/IsNull/p/1931591.html
Copyright © 2011-2022 走看看