Song.Site/Ajax/InResult.ashx.cs
(开头部分) 5KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Song.ServiceInterfaces;
using Song.Entities;
using WeiSha.WebControl;
using System.Xml;
using System.Runtime.InteropServices;
using WeiSha.Common;
namespace Song.Site.Ajax
{
/// <summary>
/// InResult._ 的摘要说明
/// </summary>
public class InResult : IHttpHandler {
//获取答题结果
private string result = WeiSha.Common.Request.Form["result"].String;
//答题结果的xml对象
private XmlDocument resXml = new XmlDocument();
public HttpResponse Response;
public HttpRequest Request;
[DllImport("Iphlpapi.dll")]
private static extern int SendARP(Int32 dest, Int32 host, ref Int64 mac, ref Int32 length);
[DllImport("Ws2_32.dll")]
private static extern Int32 inet_addr(string ip);
public void ProcessRequest (HttpContext context) {
context.Response.ContentType = "text/plain";
Response = context.Response;
Request = context.Request;
Response.ContentType = "text/xml";
Response.Flush();
Response.Buffer = true;
Response.ExpiresAbsolute = DateTime.Now.AddHours(-1);
Response.Expires = 0;
Response.CacheControl = "no-cache";
result =context. Server.UrlDecode(result);
this.Response.Write(initData());
Response.End();
}
/// <summary>
/// 初始化常用数据
/// </summary>
/// <returns>如果有错误,返回-1,如果考试结束或不存在,则返回0;正常返回1</returns>
private int initData()
{
//如果为空,则返回-1,表示错误
if (result == "") return -1;
resXml.LoadXml(result);
XmlNode xn = resXml.SelectSingleNode("results");
//试卷id,考试id
int tpid = Convert.ToInt32(xn.Attributes["tpid"].Value);
int examid = Convert.ToInt32(xn.Attributes["examid"].Value);
//学员Id,学员名称
int stid = Convert.ToInt32(xn.Attributes["stid"].Value);
string stname = xn.Attributes["stname"].Value.ToString();
//学科Id,学科名称
int sbjid = Convert.ToInt32(xn.Attributes["sbjid"].Value);
string sbjname = xn.Attributes["sbjname"].Value.ToString();
//UID与考试主题
后面还有 73 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
