日期:2014-05-17 浏览次数:20465 次
public string DecryptionParms { get { return Request.QueryString["tosee"]; //这里报错 } } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (CheckParms()) { Thread thread = new Thread(Check); thread.IsBackground = true; thread.Start(); Response.Write(" "); } } } protected static readonly RequestDetails objRequestDetails = new RequestDetails(); public void Check() { string[] parms = DecryptionParms.Split('#'); bool relParms = true; long[] longParms = new long[3]; for (int i = 0; i < 3; i++) { if (string.IsNullOrEmpty(parms[i])) { relParms = false; break; } else { relParms = long.TryParse(parms[i], out longParms[i]); if (!relParms) break; } } if (relParms) { objRequestDetails.Visitor = longParms[0]; objRequestDetails.VisitorPage = longParms[1]; objRequestDetails.VisitorPage = longParms[2]; objRequestDetails.ImageOutCode = string.Empty; objRequestDetails.Behavior = 0; //访问 try { lock (objRequestDetails) { StatisticsManager.AddRequestDetails(objRequestDetails); Thread.Sleep(1000); } Response.Write(" "); } catch (SqlException se) { Response.Write(se.Message); } } } /// <summary> /// 检查参数是否传递过来 /// </summary> /// <returns></returns> protected bool CheckParms() { if (string.IsNullOrEmpty(Request.QueryString["tosee"])) return false; else return true; }