来源:自学PHP网 时间:2015-04-14 12:58 作者: 阅读:次
[导读] publicstringToken= www0430com ; protectedvoidPage_Load(objectsender,EventArgse) { if(string IsNullOrEmpty(Request QueryString[ echoStr ])){Response End();} stringechoStr=R...
public string Token = "www0430com"; protected void Page_Load(object sender, EventArgs e) { if (string.IsNullOrEmpty(Request.QueryString["echoStr"])) { Response.End(); } string echoStr = Request.QueryString["echoStr"].ToString(); if (CheckSignature()) { if (!string.IsNullOrEmpty(echoStr)) { Response.Write(echoStr); Response.End(); } } } private bool CheckSignature() { string signature = Request.QueryString["signature"].ToString(); string timestamp = Request.QueryString["timestamp"].ToString(); string nonce = Request.QueryString["nonce"].ToString(); string[] ArrTmp = { Token, timestamp, nonce }; Array.Sort(ArrTmp); //字典排序 string tmpStr = string.Join("", ArrTmp); tmpStr = FormsAuthentication.HashPasswordForStoringInConfigFile(tmpStr, "SHA1"); tmpStr = tmpStr.ToLower(); if (tmpStr == signature) { return true; } else { return false; } }
|
自学PHP网专注网站建设学习,PHP程序学习,平面设计学习,以及操作系统学习
京ICP备14009008号-1@版权所有www.zixuephp.com
网站声明:本站所有视频,教程都由网友上传,站长收集和分享给大家学习使用,如由牵扯版权问题请联系站长邮箱904561283@qq.com