示例#1
0
文件: WinXin.cs 项目: uwitec/O2O
 /// <summary>
 /// 取得菜单
 /// </summary>
 /// <returns></returns>
 public static List<Button> GetMenu()
 {
     //取得菜单信息
     IMpClient mpClient = new MpClient();
     AccessTokenGetRequest request = new AccessTokenGetRequest()
     {
         AppIdInfo = new AppIdInfo() { AppID = appId, AppSecret = appSecret }
     };
     AccessTokenGetResponse response = mpClient.Execute(request);
     if (response.IsError)
     {
         return null;
     }
     else
     {
         GetMenuRequest getRequest = new GetMenuRequest()
         {
             AccessToken = response.AccessToken.AccessToken
         };
         var getResponse = mpClient.Execute(getRequest);
         if (getResponse.IsError)
         {
             return null;
         }
         else
         {
             var m = getResponse.Menu.menu.button;
             return m;
         }
     }
 }
示例#2
0
文件: Index.cs 项目: franknew/RiskMgr
        private void button2_Click(object sender, EventArgs e)
        {
            GetMenuRequest req = new GetMenuRequest();
            req.token = token;
            var res = SDKFactory.Client.Execute(req);

            MessageBox.Show(res.ResponseBody);
        }