<%@ WebHandler Language="C#" Class="GetOnline" %>

using System;
using System.Web;
using HuiboBll;

public class GetOnline : IHttpHandler {
    
    public void ProcessRequest (HttpContext context) {
        context.Response.ContentType = "text/plain";
        string msg = string.Empty;
        string sql = "select type,title,lnum from online order by ord";
        GetPublic Gpc = new GetPublic();
        System.Data.DataSet set = new System.Data.DataSet();
        set = Gpc.GetList(sql);
        if (set != null && set.Tables[0].Rows.Count > 0)
        {
            for (int i = 0; i < set.Tables[0].Rows.Count; i++) {
                string type = set.Tables[0].Rows[i]["type"].ToString().ToLower();
                string title = set.Tables[0].Rows[i]["title"].ToString();
                string lnum = set.Tables[0].Rows[i]["lnum"].ToString();
                
                if (type == "qq")
                    msg = msg + "<a target='_blank' href='tencent://message/?uin=" + lnum
                        + "&Site=" + title + "&Menu=yes'><img border='0' src='http://wpa.qq.com/pa?p=1:" + lnum + ":4' style='border:0px;' alt='点击这里联系我们'><span>" + title + "</span></a><br>";
                if (type == "msn")
                    msg = msg + ":<a target='blank' href='msnim:chat?contact=" + lnum + "'><img border='0' src='images/msn.gif' alt='点击这里联系我们'><span>" + title + "</span></a><br>";
                if (type == "wangwang")
                    msg = msg + ":<a target='blank' href='http://amos1.taobao.com/msg.ww?v=2&uid=" + context.Server.UrlEncode(lnum)
                        + "&site=cntaobao&s=1'><img border='0' src='http://amos1.taobao.com/online.ww?v=2&uid=" + context.Server.UrlEncode(lnum)
                        + "&site=cntaobao&s=2' alt=" + title + "><span>" + title + "</span></a><br>";
            }
        }
        context.Response.Write(msg);
    }
 
    public bool IsReusable {
        get {
            return false;
        }
    }
}