using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace LYFZ.WeixinServers
{
public partial class GetAccessToken : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string kf_account, kf_psw, app_id;
if ( VerifyParameters(out kf_account, out kf_psw, out app_id) )
{
// 获取指定appid的access token 值;
}
else
{
Response.Write("{\"code\":201, \"msg\":\"参数名不对或参数缺少\"}");
}
}
///
///
///
/// 客服账号
/// 客服密码
/// app对象Id
///
public bool VerifyParameters(out string kf_account, out string kf_psw, out string app_id )
{
kf_account = kf_psw = app_id = "";
if ( Request.Form["kf_account"] != null && Request.Form["kf_psw"] != null && Request.Form["app_id"] != null )
{
kf_account = Request.Form["kf_account"];
kf_psw = Request.Form["kf_psw"];
app_id = Request.Form["app_id"];
if ( !string.IsNullOrEmpty(kf_account) && !string.IsNullOrEmpty(kf_psw) && !string.IsNullOrEmpty(app_id) )
return true;
}
return false;
}
}
}