コード例 #1
0
            public void WeChatApiQRCodeTest()
            {
                Assert.AreEqual(JsonCreate.CreateScene(123, 604800), "{\"expire_seconds\":604800,\"action_name\":\"QR_SCENE\",\"action_info\":{\"scene\":{\"scene_id\":123}}}");
                Assert.AreEqual(JsonCreate.CreateLimitScene(123), "{\"action_name\":\"QR_LIMIT_SCENE\",\"action_info\":{\"scene\":{\"scene_id\":123}}}");
                Assert.AreEqual(JsonCreate.CreateLimitScene("123"), "{\"action_name\":\"QR_LIMIT_STR_SCENE\",\"action_info\":{\"scene\":{\"scene_str\":\"123\"}}}");

                //Config = new Api.Config("gh_69438e79ea75", "wx95dfa97f9fca2358", "4e053f53f278347179416898e3d7883a");
                //var token = Api.GetAccessToken(Config);
                //var code = Api.QRCode.CreateScene(token, 1);
                //var url = Api.QRCode.ShowUrl(code);
                //code = Api.QRCode.CreateLimitScene(token, 2);
                //url = Api.QRCode.ShowUrl(code);
                //code = Api.QRCode.CreateLimitScene(token, "2_0");
                //url = Api.QRCode.ShowUrl(code);
            }
コード例 #2
0
 public static QRScene CreateLimitScene(string access_token, string scene_str) =>
 ApiPost <QRScene>(JsonCreate.CreateLimitScene(scene_str), "/cgi-bin/qrcode/create?access_token={0}", access_token);