using System;
using System.Collections;
using System.Data;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using TopWinCMS.BLL;
namespace TopWinCMS.WebUI.Admin.FriendLink
{
    /// <summary>
    /// $codebehindclassname$ 的摘要说明
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    public class FriendLinkAJAX : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
             

            BLL.FriendLink.FriendLinkCheck MyClassBLL = new BLL.FriendLink.FriendLinkCheck(context.Request["URL"].Replace("http://", ""));

            switch (context.Request["Action"])
            {
                case "Alexa":
                    context.Response.Write(MyClassBLL.getAlexa().ToString());
                    break;

                case "Link":
                    context.Response.Write(MyClassBLL.checkLink(Config.DomainName.Replace("http://", "")));
                    break;
                case "Baidu":

                    context.Response.Write(MyClassBLL.getBaiDu().ToString());
                    break;
                case "Google":
                    context.Response.Write(MyClassBLL.getGoogle().ToString());
                    break;
             
                case "SoGou":
                    context.Response.Write(MyClassBLL.getSoGou().ToString());
                    break;
                case "SoSo":
                    context.Response.Write(MyClassBLL.getSoSo().ToString());
                    break;

                case "Yahoo":
                    context.Response.Write(MyClassBLL.getYahoo().ToString());
                    break;
            }
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}
