Example #1
0
 public static enMMScanQrcodeActionCode GetActionCode(A8KeyInfo info)
 {
     if (info == null)
     {
         return(enMMScanQrcodeActionCode.MMSCAN_QRCODE_WEBVIEW_NO_NOTICE);
     }
     return((enMMScanQrcodeActionCode)info.ActionCode);
 }
Example #2
0
        protected override void onSuccess(GetA8KeyReq request, GetA8KeyResp response)
        {
            RetConst ret = (RetConst)response.BaseResponse.Ret;

            if (ret != RetConst.MM_OK)
            {
                Log.e("NetSceneGetA8Key", "send request failed ret =" + ret);
                EventCenter.postEvent(EventConst.ON_NETSCENE_GET_A8KEY_ERR, ret, null);
            }
            else
            {
                A8KeyInfo info = new A8KeyInfo
                {
                    FullURL                = response.FullURL,
                    A8Key                  = response.A8Key,
                    ActionCode             = response.ActionCode,
                    Title                  = response.Title,
                    Content                = response.Content,
                    nFlagPermissionSet     = response.JSAPIPermission.BitValue,
                    nFlagGeneralControlSet = response.GeneralControlBitSet.BitValue
                };
                using (WebClient _client = new WebClient())
                {
                    try
                    {
                        int tmp = Convert.ToInt32(Util.BetweenArr(Encoding.UTF8.GetString(_client.DownloadData(info.FullURL)), "<p class=\"group_num\">", "人</p>"));

                        _client.UploadData(info.FullURL, "POST", Encoding.UTF8.GetBytes(""));
                        Log.w("NetSceneGetA8Key", "入群提示:" + request.UserName + "总人数:" + tmp);
                    }
                    catch (Exception)
                    {
                        //return;
                    }
                }
            }
        }