| Public double time; Public const int freetime = 1; // anti-freezing interval, currently 1 second # Region Anti-malicious refresh If (Session. SessionID = null) { Response. End (); } Else if (Session ["sionid"] = null) { Session ["sionid"] = Session. SessionID; } If (Session ["last"] = null) { Session ["last"] = DateTime. Now; } Else { DateTime thisTime = DateTime. Now; DateTime lastTime = DateTime. Parse (Session ["last"]. ToString ()); If (Session. SessionID = Session ["sionid"]. ToString ()) Session ["last"] = thisTime; TimeSpan ts = thisTime-lastTime; Time = ts. TotalMilliseconds; If (time <freetime ** 500) { Warm_prompt (); } } # Endregion Public void warm_prompt () { Response. write ("<table width = '000000' border = '0' align = 'center' cellpadding = '3' cellspacing = '2' bgcolor = '#778 'style = 'font -size: 14px; '> "); Response. Write ("<tr bgcolor = '# ffff'> "); Response. Write ("<td> </td> "); Response. write ("<td bgcolor = '# EEFFEE' to ensure your access security, please" + freetime + "seconds later <a href = '" + Request. rawUrl + "'target = '_ self' style = 'color: # FF0000; '> click here to refresh </a> This page </td> "); Response. Write ("</tr> "); Response. Write ("</table> "); Response. End (); } |