1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- 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\":\"参数名不对或参数缺少\"}");
- }
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="kf_account">客服账号</param>
- /// <param name="kf_psw">客服密码</param>
- /// <param name="app_id">app对象Id</param>
- /// <returns></returns>
- 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;
- }
- }
- }
|