1 <%@ WebHandler Language="C#" Class="Handler" %>
2
3 using System;
4 using System.Web;
5 using System.Collections.Generic;
6 using System.Data;
7 using System.Data.SqlClient;
8
9 public class Handler : IHttpHandler {
10
11 public void ProcessRequest (HttpContext context) {
12 context.Response.ContentType = "text/plain";
13 string json = "[";
14 for (int i = 0; i < SelectMessage().Count; i++)
15 {
16 int today = DateTime.Now.Day;
17 string b = SelectMessage()[i].Birthday.ToString();
18 string[] s = b.Split(-);
19 int birthday = Convert.ToInt32(s[2]);
20 int c = birthday - today;
21
22 if (c < 0) { c = c + 30; }
23
24 json += "{UserName:" + SelectMessage()[i].UserName.ToString() + ",Birthday:" + c +"},";