/// <summary> /// 创建QRCode /// </summary> /// <param name="QrCard"></param> /// <returns></returns> public static QRCardTicket CreateQRCard(QrCard card) { WeiXinSDK.WeiXin.CheckGlobalCredential(); return CreateQRCard(card, WeiXinSDK.WeiXin.AppID, WeiXinSDK.WeiXin.AppSecret); }
/// <summary> /// 创建二维码ticket /// </summary> /// <param name="QrCard"></param> /// <param name="appId"></param> /// <param name="appSecret"></param> /// <returns></returns> public static QRCardTicket CreateQRCard(QrCard card, string appId, string appSecret) { string url = "https://api.weixin.qq.com/card/qrcode/create?access_token="; string access_token = WeiXinSDK.WeiXin.GetAccessToken(appId, appSecret); url = url + access_token; var json = Util.HttpPost2(url, Util.ToJson(card)); return Util.JsonTo<QRCardTicket>(json); }