C#

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
public class SMS {
     static void Main() {
         /* Change this to your username */ 
         string user = "myuser";
         /* Change this to your password */ 
         string pass = "mypass";

         /* This is the short message to be sent */ 
         string msg = "test";
         /* Sender of the short message */ 
         string from = "+46712345678";
         /* Recipient of the short message */ 
         string to = "+467123456789";
         /* Construct the URL */ 
         string url = "http://get.spiricom.spirius.com:55000/cgi-bin/sendsms?User=" + user + "&Pass=" + pass +"&From=" + from +"&To=" + to + "&Msg=" + msg;

         /* Create and send the GET - request and then parse the response as a string */ 
         string result;
         try {
             System.Net.WebClient webClient = new System.Net.WebClient();
             result = webClient.DownloadString(url);
         } catch (System.Exception e) {
             result = e.ToString();
         }
         System.Console.WriteLine(result);
    }
}
Back to top