如何从WPF应用程序发送SMS

时间:2013-09-26 06:52:14

标签: wpf c#-4.0 sms

我想通过短信网关或任何其他网关从我的wpf应用程序向特定手机号码发送短信

我尝试过以下代码,但它无效

using smsclient;
private void button1_Click(object sender, RoutedEventArgs e)
    {
        string waytosmsid = "123456789";
        string password = "********";

      //  Now use this code to send the sms and check the internet status and whether users exist.

        SendSms sms = new SendSms();

        string status = sms.send(waytosmsid, password, textBox3.Text, textBox4.Text);

        if (status == "1")
        {
           MessageBox.Show("Message Send");
        }
        else if (status == "2")
        {
           MessageBox.Show("No Internet Connection");
        }
        else
        {
           MessageBox.Show("Invalid Login Or No Internet Connection");
        }
   }

0 个答案:

没有答案