How to Check SMS Balance with C# - Version 1

Below 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.


Bulk SMS Malaysia - How to send sms using C#

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.


Bulk SMS Malaysia - How to send sms using C#

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.


Bulk SMS Malaysia - How to send sms using C#

Please click below to download demo files:


Download C# Demo Scripts   Download C# Installer



Contact Us

Please 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:

  • 1800 87 7061 (Malaysia Toll Free)
  • +604 642 0621 (Penang, Malaysia)
  • +603 2780 3880 (Line 1 Kuala Lumpur, Malaysia)
  • +603 7980 1388 (Line 2 Kuala Lumpur, Malaysia)

Fax:

  • +604 611 5620 (Penang, Malaysia)
  • +603 7980 2388 (Kuala Lumpur, Malaysia)

Articles

 

SMS Coverage for All Countries Worldwide

A B C D E F G H I J K L M N O P Q R S T U V Y Z
divider