VB.net code example

ViaNett provides you with code examples and programming objects, to help you connect to our gateway using the programming language of your choice. You are welcome to try these scripts. Sign up now to get 5 free SMS.

What is VB.net?

Visual Basic .NET (VB.NET) is an object-oriented programming language that can be viewed as an evolution of Microsoft's Visual Basic (VB), implemented on the Microsoft .NET Framework. Microsoft also supplies a powerful version free of charge.

VB.net example code

This example code uses a ready-made object, based on the HTTP API. To use this script, simply register for free and get 5 free SMS.
        Dim s As New ViaNettSMS(username:="YourUsername", password:="YourPassword")
        Dim result As ViaNettSMS.Result
        Try
            result = s.sendSMS(msgsender:="4790000000", destinationaddr:="4790000000", message:="hello world")
 
            If result.Success Then
                Debug.WriteLine("Message successfully sent")
            Else
                Debug.WriteLine("Received error: " & result.ErrorCode & " " & result.ErrorMessage)
            End If
 
        Catch ex As System.Net.WebException
            'Error occurred while connecting to server.
            Debug.WriteLine(ex.Message)
        End Try

"ViaNettSMS" VB.net object

ViaNett provides you with an object/class in VB.NET, based on the HTTP API. The source code is available for download.

Download source code

You need to log in to download the source code. Sign up now and get 5 free SMS messages.
Click here to download the source code.