1800 87 7061 (Malaysia Toll Free) +603 2780 3880 (KL)
How to Check SMS Balance with C# - Version 1Below is some sample check SMS Balance scripts prepared by our iSMS team. 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 C# application and enjoy our SMS services. Please click below to find out about other programming language samples. Download C# Demo Scripts Download C# Installer Please register HERE to be iSMS member to obtain your iSMS account username and password.
using System;
using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Diagnostics; using System.Drawing; using System.Linq; using System.Text; using System.Net; using System.Windows.Forms; using System.IO; using Microsoft.VisualBasic; namespace WindowsFormsApplication2 { public partial class frmChkBal : Form { public frmChkBal() { InitializeComponent(); } private void frmChkBal_Load(object sender, EventArgs e) { this.txtUser.Select(); } private bool CheckErrors() { if (txtUser.Text.Trim() == String.Empty) return true; if (txtPass.Text.Trim() == String.Empty) return true; return false; } private void btnChkBal_Click(object sender, EventArgs e) { if (CheckErrors()) { MessageBox.Show("Please enter Your Username & Password", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error); btnClear.Visible = true; txtPass.Clear(); txtUser.Clear(); txtUser.Select(); } else { Uri url = new Uri("https://www.isms.com.my/isms_balance.php?un=" + txtUser.Text + "&pwd=" + txtPass.Text); WebRequest myweb = WebRequest.Create(url); WebResponse mywebres = myweb.GetResponse(); StreamReader read = new StreamReader(mywebres.GetResponseStream()); String balance_str = read.ReadToEnd(); lblGetBal.Text = balance_str; txtPass.Clear(); txtUser.Clear(); txtUser.Select(); btnClear.Visible = true; btnClear.Enabled = true; } } private void btnClear_Click_1(object sender, EventArgs e) { lblGetBal.Text = ""; txtUser.Clear(); txtPass.Clear(); txtUser.Select(); } } } 1. You have to fill in your iSMS account details such as username and password. Then, click on button "Check Balance" to check balance. If you have not registered, please click HERE to get a FREE account with iSMS. ![]() 2. You credit balance will be appear as figure below. Beside that, there is a "Clear All" button is to clear username, password and your balance there. ![]() 3. You will see an error message as shown in the figure below if you leave username or password fields blank. Click on "OK" to continue. ![]() Please click below to download demo files: Download C# Demo Scripts Download C# Installer 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:
|