SMS Scripts - VB.Net

Shreeweb provides you with some ready-made scripts that are available to help you connect to our gateway through your chosen programming language. These scripts all work with the HTTP API. Click here ot Contact Us and try our service.

Send SMS with VB.Net:

Use the VB.Net code below to send SMS via the Shreeweb SMS Gateway. Simply Contact Us for an HTTP API account, and you will receive an test account with free credits to try our service.

Code Sample:

Imports System.Net
Imports System.IO
Dim client As WebClient = New WebClient
' Add a user agent header in case the requested URI contains a query.
client.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR
client.QueryString.Add("username", "xxxx")
client.QueryString.Add("password", "xxxx")
client.QueryString.Add("type", "TEXT")
client.QueryString.Add("mobile", "xxxx")
client.QueryString.Add("sender", "xxxx")
client.QueryString.Add("message", "This is an example message")
Dim baseurl As String = "http://sms.shreeweb.com/sendsms/sendsms.php"
Dim data As Stream = client.OpenRead(baseurl)
Dim reader As StreamReader = New StreamReader(data)
Dim s As String = reader.ReadToEnd()

Last Updated on Thursday, 10 October 2013 01:29
Copyright © 2022 Shreeweb | All Rights Reserved.