Web5/Admin/ueditor/net/getMovie.ashx

(完整代码) 1KB

<%@ WebHandler Language="C#" Class="getMovie" %>
/**
 * Created by visual studio 2010
 * User: xuheng
 * Date: 12-3-7
 * Time: 下午14:45
 * To change this template use File | Settings | File Templates.
 */
using System;
using System.Web;
using System.Net;
using System.Text;

public class getMovie : IHttpHandler {
    
    public void ProcessRequest (HttpContext context) {
        context.Response.ContentType = "text/html";
        string key = context.Server.HtmlEncode(context.Request.Form["searchKey"]);
        string type = context.Server.HtmlEncode(context.Request.Form["videoType"]);

        Uri httpURL = new Uri("http://api.tudou.com/v3/gw?method=item.search&appKey=myKey&format=json&kw="+key+"&pageNo=1&pageSize=20&channelId="+type+"&inDays=7&media=v&sort=s");
        WebClient MyWebClient = new WebClient();


        MyWebClient.Credentials = CredentialCache.DefaultCredentials;           //获取或设置用于向Internet资源的请求进行身份验证的网络凭据
        Byte[] pageData = MyWebClient.DownloadData(httpURL); 

        context.Response.Write(Encoding.UTF8.GetString(pageData));
    }
 
    public bool IsReusable {
        get {
            return false;
        }
    }
}

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。