当前位置: 首页>>代码示例>>C#>>正文


C# Tropo.Message方法代码示例

本文整理汇总了C#中TropoCSharp.Tropo.Tropo.Message方法的典型用法代码示例。如果您正苦于以下问题:C# Tropo.Message方法的具体用法?C# Tropo.Message怎么用?C# Tropo.Message使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TropoCSharp.Tropo.Tropo的用法示例。


在下文中一共展示了Tropo.Message方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ExecuteSession

        /// <summary>
        /// Must be used from an endpoint URL. 
        /// This will parse the active session and send the specified messages. 
        /// As of now, it only supports sending through the MSN Network IM
        /// </summary>
        /// <param name="reader"></param>
        /// <param name="messages"></param>
        /// <returns></returns>
        public static string ExecuteSession(StreamReader reader, Dictionary<string, List<string>> messages)
        {
            string sessionJSON = reader.ReadToEnd();
            Tropo tropo = new Tropo();
            try
            {
                Session tropoSession = new Session(sessionJSON);

                foreach (var kvp in messages)
                {
                    string to = kvp.Key;
                    string from = "[email protected]";

                    foreach (string msg in kvp.Value)
                    {
                        tropo.Message(new Say(msg), new List<string>() { to }, false, Channel.Text, from, from, Network.Msn, false, 30);
                    }
                }

            }
            catch
            {
            }
            return tropo.RenderJSON();
        }
开发者ID:Aralcom,项目名称:Parking,代码行数:33,代码来源:Tropo.cs

示例2: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            // Create a new instance of the Tropo object.
            Tropo tropo = new Tropo();

            // Set the voice to use when saying a prompt.
            tropo.Voice = Voice.UsEnglishMale;

            // A prompt to give the say to the recipient.
            Say say = new Say("Remember you have a meeting at 2 PM");

            // An ArrayList to hold the numbers to call (first call answered hears the prompt).
            List<String> to = new List<String>();
            to.Add("3055195825");
            to.Add("3054445567");

            // Create an endpoint object to denote who the call is from.
            string from = "7777777777";

            // Call the message method of the Tropo object and pass in values.
            tropo.Message(say, to, false, Channel.Voice, from, "reminder", Network.Pstn, true, 60);

            // Render the JSON for Tropo to consume.
            Response.Write(tropo.RenderJSON());
        }
开发者ID:nSource,项目名称:tropo-webapi-csharp,代码行数:25,代码来源:SendMessage.aspx.cs

示例3: testMessageUseAllOptions

        public void testMessageUseAllOptions()
        {
            Say say = new Say("This is an announcement");
            Tropo tropo = new Tropo();
            tropo.Voice = Voice.BritishEnglishFemale;
            string from = "3055551212";
            List<String> to = new List<String>();
            to.Add("3055195825");
            tropo.Message(say, to, false, Channel.Text, from, "foo", Network.SMS, true, 10);

            Assert.AreEqual(this.messageJsonAllOptions, tropo.RenderJSON());
        }
开发者ID:nSource,项目名称:tropo-webapi-csharp,代码行数:12,代码来源:TropoClassesTests.cs

示例4: testMessageFromObject

        public void testMessageFromObject()
        {
            Say say = new Say("This is an announcement");
            string from = "3055551212";
            Message message = new Message();
            List<String> to = new List<String>();
            to.Add("3055195825");
            message.Say = say;
            message.To = to;
            message.From = from;
            message.AnswerOnMedia = false;
            message.Channel = Channel.Text;
            message.Network = Network.SMS;
            message.Timeout = 10;

            Tropo tropo = new Tropo();
            tropo.Voice = Voice.BritishEnglishFemale;
            tropo.Message(message);

            Assert.AreEqual(this.messageJson, tropo.RenderJSON());
        }
开发者ID:nSource,项目名称:tropo-webapi-csharp,代码行数:21,代码来源:TropoClassesTests.cs


注:本文中的TropoCSharp.Tropo.Tropo.Message方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。