public void SendMultiMessage()
        {
            IAppConfig      appConfig       = new VoiceAppConfig("apppid", "appkey");
            VoiceMultiXSend voiceMultiXSend = new VoiceMultiXSend(appConfig);

            voiceMultiXSend.SetProject("WZlIv3");

            Dictionary <string, string> vars = new Dictionary <string, string>();

            vars.Add("place", "上海");
            vars.Add("name", "xx");

            Dictionary <string, string> vars2 = new Dictionary <string, string>();

            vars2.Add("place", "北京");
            vars2.Add("name", "xx");

            voiceMultiXSend.SetMulti(new List <MultiMessageItem>()
            {
                new MultiMessageItem()
                {
                    to = "176xxxx5149", vars = vars
                },
                new MultiMessageItem()
                {
                    to = "133xxxx55482", vars = vars2
                },
            });

            string returnMessage = string.Empty;

            voiceMultiXSend.MultiXSend(out returnMessage);
            Console.WriteLine(returnMessage);
            Console.ReadKey();
        }
示例#2
0
        public void balance()
        {
            IAppConfig   appConfig     = new VoiceAppConfig("appid", "appkey", SignType.sha1);
            VoiceBalance submail       = new VoiceBalance(appConfig);
            string       returnMessage = string.Empty;

            submail.Balance(out returnMessage);
            Console.WriteLine(returnMessage);
            Console.ReadKey();
        }
示例#3
0
        public void SendVoice()
        {
            IAppConfig appConfig = new VoiceAppConfig("appid", "appkey");
            VoiceSend  voiceSend = new VoiceSend(appConfig);

            voiceSend.AddTo("176025149");
            voiceSend.AddContent("欢迎来到江苏,welcome to china");
            string returnMessage = string.Empty;

            voiceSend.Send(out returnMessage);
            Console.WriteLine(returnMessage);
            Console.ReadKey();
        }
示例#4
0
        public void SendVoiceVerify()
        {
            IAppConfig  appConfig   = new VoiceAppConfig("appid", "appkey");
            VoiceVerify voiceVerify = new VoiceVerify(appConfig);

            voiceVerify.AddTo("176xxxx5149");
            voiceVerify.SetCode("1234543");
            string returnMessage = string.Empty;

            voiceVerify.Verify(out returnMessage);
            Console.WriteLine(returnMessage);
            Console.ReadKey();
        }
        public void VoiceVerify()
        {
            IAppConfig  appConfig   = new VoiceAppConfig("20139", "aeefd6d1170a354aa9282a04138c59ee");
            VoiceVerify voiceVerify = new VoiceVerify(appConfig);

            voiceVerify.AddTo("13756563150");
            // 此数字为语音播报的4位数字验证码
            voiceVerify.SetCode("1234");
            string returnMessage = string.Empty;

            if (voiceVerify.Verify(out returnMessage) == false)
            {
                Console.WriteLine(returnMessage);
            }
        }
示例#6
0
        public void XSendVoice()
        {
            IAppConfig appConfig  = new VoiceAppConfig("apppid", "appkey");
            VoiceXSend voiceXSend = new VoiceXSend(appConfig);

            voiceXSend.AddTo("176115149");
            voiceXSend.SetProject("WZlIv3");
            voiceXSend.AddVar("name", "张杨");
            voiceXSend.AddVar("place", "江湖大道");
            string returnMessage = string.Empty;

            voiceXSend.XSend(out returnMessage);
            Console.WriteLine(returnMessage);
            Console.ReadKey();
        }