1800 87 7061 (Malaysia Toll Free) +603 2780 3880 (KL)
Check SMS balance with VB.NETIntegrating check SMS balance feature is easy when using iSMS API. Below is an example of integrating iSMS features in your VB.NET application. To understand more about our iSMS API Key features, please visit our Developer API page. All available features and configurations will be displayed at the iSMS Developer API page. Integrate our SMS API into your VB.NET application and enjoy our SMS services. Download VB.NET Demo Files Please click below to find out about other programming language samples. 1. First of all, user will able to see this form as illustration 1. This form is to check balance on their bulksms account. 2. User have to key in their username and password and click on "Check Balance" button to proceed. 3. After clicked on "Check Balance" button user will able to see their balance as illustration 3 below. And clear button is pop out. This button purpose is to clear form. 4. To check next account balance, user can click on clear to clear form or direct key in username and password to proceed. As user want to check balance have to go through from step 1 to 2. 5. Error Message will show up as illustration 5 below. When user did not click on anything and direct press on "Check Balance" button. Click on "OK" to continue. Below is some sample script for your reference.
Imports System
Imports System.Uri Imports System.Net Imports System.IO Imports System.Data Imports System.Windows.Forms Imports System.Text Public Class isms_balance 'This is a function when user has clicked on button check' Private Sub btnCheck_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCheck.Click 'Checking if user leave blank on username and password space' If (txtPass.Text() & txtUser.Text() <> "") Then 'Creating a uri' Dim url As New Uri("https://www.isms.com.my/isms_balance.php?un=" + txtUser.Text + "&pwd=" + txtPass.Text) 'Creating a variable for WebRequest' Dim req As WebRequest req = WebRequest.Create(url) 'Creating a variable for WebResponse' Dim resp As WebResponse 'Try and catch clause, to catch if there is error' Try resp = req.GetResponse() Dim reader As StreamReader reader = New StreamReader(resp.GetResponseStream()) Dim balance_str As String = Trim(reader.ReadToEnd.Trim()) resp.Close() 'Getting user balance into a label' lblGetBal.Text = balance_str req = Nothing Catch ex As Exception 'If get error system will pop-out a message' req = Nothing MsgBox(ex.Message) End Try txtPass.Clear() txtUser.Clear() txtUser.Focus() btnClear.Visible = True btnClear.Enabled = True Else 'A message box will appear when username and password is blank' MessageBox.Show("Please enter your Username and Password", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error) txtUser.Focus() lblGetBal.Text = "" btnClear.Visible = True End If End Sub 'A Clear button to let user clear our previous checked balance' Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click txtPass.Clear() txtUser.Clear() lblGetBal.Text = "" End Sub End Class Please click below to download demo files: Download VB.NET Demo Files Contact UsPlease contact us HERE, if you have any enquiries or looking for any consultation. Email: sales@mobiweb.com.my Note to registered users: Please include your Username in the email. Phone Numbers:
Fax:
|