-
Notifications
You must be signed in to change notification settings - Fork 0
/
GetPlayer.ashx.cs
40 lines (36 loc) · 1.05 KB
/
GetPlayer.ashx.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
namespace MilitaryChess
{
/// <summary>
/// GetPlayerFace 的摘要说明
/// </summary>
public class GetPlayerFace : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
String sql = "select * from tableready where id=1";
DataSet ds = DBUtility.SQLDbHelper.Query(sql);
DataRow row = ds.Tables[0].Rows[0];
List<String> strlist = new List<String>();
String result = "[";
for (Int32 i = 0; i < 4; i++)
{
strlist.Add("{\"player\":\"" + row["player" + i] + "\",\"ready\":\"" + row["ready" + i] + "\"}");
}
result = result + String.Join(",", strlist) + "]";
context.Response.Write(result);
}
public bool IsReusable
{
get
{
return false;
}
}
}
}