Minggu, 29 April 2012
Program C# SMS Gateway
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Quiz_sms_gateway
{
class Program
{
static void Main(string[] args)
{
string[] kodenasabah = { "N-0001", "N-0002", "N-0003", "N-0004", "N-0005" };
string[] nama = { "Andi", "Yanto", "Anisa", "Yunita", "Andri" };
string[] password = { "123456", "135791", "246802", "124578", "963842" };
string[] saldo = { "2.360.000", "809.870", "934.000", "6.890.999", "99.000" };
string a;
string pilihan;
ulang:
Console.WriteLine("SELAMAT DATANG DILAYANAN SMS GATEWAY ");
Console.WriteLine("========================================");
Console.WriteLine(" ");
Console.Write("Ketik SMS :");
a = Console.ReadLine();
Console.WriteLine(" ");
if (a == "info#format")
{
Console.WriteLine("Format SMS yang bisa dipakai adalah: ");
Console.WriteLine(" ");
Console.WriteLine("1.\"info#format\": untuk mengecek format sms ");
Console.WriteLine(" ");
Console.WriteLine("2.\"info#saldo#kodenasabah#password\": untuk mengecek saldo nasabah ");
Console.WriteLine(" ");
Console.WriteLine("3.\"Contoh\": info#saldo#N-0001#123456 ");
}
else if (a == "info#saldo#" + kodenasabah[0] + "#" + password[0])
{
Console.WriteLine("terima kasih " + nama[0] + " " + "[" + kodenasabah[0] + "]" + " saldo anda adalah " + saldo[0]);
}
else if (a == "info#saldo#" + kodenasabah[1] + "#" + password[1])
{
Console.WriteLine("terima kasih " + nama[1] + " " + "[" + kodenasabah[1] + "]" + " saldo anda adalah " + saldo[1]);
}
else if (a == "info#saldo#" + kodenasabah[2] + "#" + password[2])
{
Console.WriteLine("terima kasih " + nama[2] + " " + "[" + kodenasabah[2] + "]" + " saldo anda adalah " + saldo[2]);
}
else if (a == "info#saldo#" + kodenasabah[3] + "#" + password[3])
{
Console.WriteLine("terima kasih " + nama[3] + " " + "[" + kodenasabah[3] + "]" + " saldo anda adalah " + saldo[3]);
}
else if (a == "info#saldo#" + kodenasabah[4] + "#" + password[4])
{
Console.WriteLine("terima kasih " + nama[4] + " " + "[" + kodenasabah[4] + "]" + " saldo anda adalah " + saldo[4]);
}
else if (a == "inof#saldo#n-0001#123456")
{
Console.WriteLine("Maaf. Format SMS yang Anda kirim salah. ");
Console.WriteLine("Ketik \"info#format\" untuk mengetahui format sms yang ada.");
}
Console.WriteLine(" ");
Console.Write("apakah ingin mengulangi[y/n]? ");
pilihan = Console.ReadLine();
if (pilihan.Equals("y"))
{
Console.WriteLine(" ");
goto ulang;
}
else
{
Console.Clear();
Console.WriteLine("Terima kasih telah menggunakan layanan sms getway");
Console.WriteLine("====================================");
Console.ReadKey();
}
}
}
}
Langganan:
Posting Komentar (Atom)
Tidak ada komentar:
Posting Komentar