const string Token = "你的token";
protected void Page_Load(object sender, EventArgs e)
{
if (Request.HttpMethod.ToLower() == "post")
{
}
else
{
Valid();
}
}
//验证token
private void Valid()
{
string echoStr = Request.QueryString["echoStr"].ToString();//微信自动传过来的echostr
if (CheckSignature())
{
if (!string.IsNullOrEmpty(echoStr))//当随机数和token验证成功后,返回echostr给微信,就可以了
{
Response.Write(echoStr);
Response.End();
}
}
protected void Page_Load(object sender, EventArgs e)
{
if (Request.HttpMethod.ToLower() == "post")
{
}
else
{
Valid();
}
}
//验证token
private void Valid()
{
string echoStr = Request.QueryString["echoStr"].ToString();//微信自动传过来的echostr
if (CheckSignature())
{
if (!string.IsNullOrEmpty(echoStr))//当随机数和token验证成功后,返回echostr给微信,就可以了
{
Response.Write(echoStr);
Response.End();
}
}
}
/// <summary>
/// 验证微