什么是C#中的RestClient以及如何使用它在任何手机中发送短信 [英] What is RestClient in C# and how to use it to send a text message in any mobile phone

查看:489
本文介绍了什么是C#中的RestClient以及如何使用它在任何手机中发送短信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

public class MobileSMS
{
    public MobileSMS() { }

    public void SendMessage(string MobileNumber, string Message)
    {
        if (bool.Parse(ConfigurationManager.AppSettings["SendSMS"]))
        {
            try
            {
                RestClient rClient = new RestClient("1256", "123", RestClient.ENV_PRODUCTION);
                Hashtable result = rClient.sendSMS(Message, MobileNumber, "Cash Club", 72, "", "");
            }
            catch
            {
            }
        }       
    }
}



这是这里的代码我无法理解这个restclient是如何工作的


this is the code here i am unable to understand how this restclient is working

推荐答案

Hello Alok,



如果我猜对了,你正在使用 TextMarketer SMS [ ^ ]位于GitHub上的库。 try块中的第一行创建RestClient实例,第一个参数是用户名,第二个是TextMarketer帐户的密码。最后一个参数表示要使用的环境。 Sandbox环境用于模拟/测试目的,而Production用于实际工作。第二行实际上启动了交付过程。



通过查看前面提到的链接中找到的代码,可以找到RestClient的工作原理。



问候,
Hello Alok,

If I am guessing right, you are using RestClient class from TextMarketer SMS[^] Library located on GitHub. The first line in the try block creates the RestClient instance the first argument being the user name, second being the password of your TextMarketer account. The last parameter represents the environment to be used. The Sandbox environment is used for simulation/testing purpose while Production is used for actually work. The second line actually initiates the delivery process.

How exactly the RestClient works can be found by looking at the code found at the link mentioned earlier.

Regards,


这篇关于什么是C#中的RestClient以及如何使用它在任何手机中发送短信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆