VB.NET

 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
28
29
30
31
32
33
Module SMS

 Sub Main()
  'SPIRIcom HTTP GET VB.NET example

  'Change this to your username
  Dim user As String = "myuser"

  'Change this to your password
  Dim pass As String = "mypass"

  'Sender of the short message
  Dim from As String = "+467123456789"

  'Recipient of the short message
  Dim toNumber As String = "+467123456789"

  'This is the short message to be sent
  Dim msg As String = "test"

  'Create and send the GET-request and then parse the response as a string
  Dim result As String
  Try
   Dim webClient As System.Net.WebClient = New System.Net.WebClient()
   result = webCLient.DownloadString("http://get.spiricom.spirius.com:55000/cgi-bin/sendsms?User=" + user + "&Pass=" + pass + "&From=" + from + "&To=" + toNumber + "&Msg=" + msg)
  Catch ex as Exception
   result = ex.Message
  End Try

  System.Console.Write(result)
 End Sub

End Module
Back to top