CSharp Example

From CDYNE Wiki
Jump to: navigation, search

Check Phone Number

/*http://ws.cdyne.com/phoneverify/phoneverify.asmx?wsdl was added as Web Reference and given the name WSDL*/
 
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CheckPhoneNumber.WSDL;
 
namespace CheckPhoneNumber
{
class Program
{
static void Main(string[] args)
{
WSDL.PhoneVerify PV = new WSDL.PhoneVerify();
WSDL.PhoneReturn PR = new WSDL.PhoneReturn();
 
PR = PV.CheckPhoneNumber("17575449510", "YOUR LICENSE KEY");
 
Console.WriteLine("Company: " + (string.IsNullOrEmpty(PR.Company) ? "No Information Found" : PR.Company));
Console.WriteLine("Valid: " + PR.Valid);
Console.WriteLine("Use: " + (string.IsNullOrEmpty(PR.Use) ? "No Information Found" : PR.Use));
Console.WriteLine("State: " + (string.IsNullOrEmpty(PR.State) ? "No Information Found" : PR.State));
Console.WriteLine("Switch: " + (string.IsNullOrEmpty(PR.Switch) ? "No Information Found" : PR.Switch));
Console.WriteLine("RC: " + (string.IsNullOrEmpty(PR.RC) ? "No Information Found" : PR.RC));
Console.WriteLine("OCN: " + (string.IsNullOrEmpty(PR.OCN) ? "No Information Found" : PR.OCN));
Console.WriteLine("Original Number: " + (string.IsNullOrEmpty(PR.OriginalNumber) ? "No Information Found" : PR.OriginalNumber));
Console.WriteLine("Clean Number: " + (string.IsNullOrEmpty(PR.CleanNumber) ? "No Information Found" : PR.CleanNumber));
Console.WriteLine("Switch Name: " + (string.IsNullOrEmpty(PR.SwitchName) ? "No Information Found" : PR.SwitchName));
Console.WriteLine("Switch Type: " + (string.IsNullOrEmpty(PR.SwitchType) ? "No Information Found" : PR.SwitchType));
Console.WriteLine("Country: " + (string.IsNullOrEmpty(PR.Country) ? "No Information Found" : PR.Country));
Console.WriteLine("CLLI: " + (string.IsNullOrEmpty(PR.CLLI) ? "No Information Found" : PR.CLLI));
Console.WriteLine("Prefix Type: " + (string.IsNullOrEmpty(PR.PrefixType) ? "No Information Found" : PR.PrefixType));
Console.WriteLine("LATA: " + (string.IsNullOrEmpty(PR.LATA) ? "No Information Found" : PR.LATA));
Console.WriteLine("SMS: " + (string.IsNullOrEmpty(PR.sms) ? "No Information Found" : PR.sms));
Console.WriteLine("Date Assigned: " + (string.IsNullOrEmpty(PR.AssignDate) ? "No Information Found" : PR.AssignDate));
Console.WriteLine("Telecom City: " + (string.IsNullOrEmpty(PR.TelecomCity) ? "No Information Found" : PR.TelecomCity));
Console.WriteLine("Telecom County: " + (string.IsNullOrEmpty(PR.TelecomCounty) ? "No Information Found" : PR.TelecomCounty));
Console.WriteLine("Telecom State: " + (string.IsNullOrEmpty(PR.TelecomState) ? "No Information Found" : PR.TelecomState));
Console.WriteLine("Telecom Zip: " + (string.IsNullOrEmpty(PR.TelecomZip) ? "No Information Found" : PR.TelecomZip));
Console.WriteLine("Time Zone: " + (string.IsNullOrEmpty(PR.TimeZone) ? "No Information Found" : PR.TimeZone));
Console.WriteLine("Latitude: " + (string.IsNullOrEmpty(PR.Lat) ? "No Information Found" : PR.Lat));
Console.WriteLine("Longitude: " + (string.IsNullOrEmpty(PR.Long) ? "No Information Found" : PR.Long));
Console.WriteLine("Wireless: " + PR.Wireless);
 
Console.ReadLine();
}
}
}

Check Phone Numbers

/*http://ws.cdyne.com/phoneverify/phoneverify.asmx?wsdl was added as Web Reference and given the name WSDL*/
 
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CheckPhoneNumbers.WSDL;
 
namespace CheckPhoneNumbers
{
class Program
{
static void Main(string[] args)
{
WSDL.PhoneVerify PV = new WSDL.PhoneVerify();
 
String PhoneNumbers = "17575449510, 18009843710";
string[] PhoneNumbersArray = PhoneNumbers.Split(',');
const string LicenseKey = "YOUR LICENSE KEY";
 
Array Numbers = PV.CheckPhoneNumbers(PhoneNumbersArray, LicenseKey);
 
foreach (WSDL.PhoneReturn PR in Numbers)
{
Console.WriteLine("Company: " + (string.IsNullOrEmpty(PR.Company) ? "No Information Found" : PR.Company));
Console.WriteLine("Valid: " + PR.Valid);
Console.WriteLine("Use: " + (string.IsNullOrEmpty(PR.Use) ? "No Information Found" : PR.Use));
Console.WriteLine("State: " + (string.IsNullOrEmpty(PR.State) ? "No Information Found" : PR.State));
Console.WriteLine("Switch: " + (string.IsNullOrEmpty(PR.Switch) ? "No Information Found" : PR.Switch));
Console.WriteLine("RC: " + (string.IsNullOrEmpty(PR.RC) ? "No Information Found" : PR.RC));
Console.WriteLine("OCN: " + (string.IsNullOrEmpty(PR.OCN) ? "No Information Found" : PR.OCN));
Console.WriteLine("Original Number: " + (string.IsNullOrEmpty(PR.OriginalNumber) ? "No Information Found" : PR.OriginalNumber));
Console.WriteLine("Clean Number: " + (string.IsNullOrEmpty(PR.CleanNumber) ? "No Information Found" : PR.CleanNumber));
Console.WriteLine("Switch Name: " + (string.IsNullOrEmpty(PR.SwitchName) ? "No Information Found" : PR.SwitchName));
Console.WriteLine("Switch Type: " + (string.IsNullOrEmpty(PR.SwitchType) ? "No Information Found" : PR.SwitchType));
Console.WriteLine("Country: " + (string.IsNullOrEmpty(PR.Country) ? "No Information Found" : PR.Country));
Console.WriteLine("CLLI: " + (string.IsNullOrEmpty(PR.CLLI) ? "No Information Found" : PR.CLLI));
Console.WriteLine("Prefix Type: " + (string.IsNullOrEmpty(PR.PrefixType) ? "No Information Found" : PR.PrefixType));
Console.WriteLine("LATA: " + (string.IsNullOrEmpty(PR.LATA) ? "No Information Found" : PR.LATA));
Console.WriteLine("SMS: " + (string.IsNullOrEmpty(PR.sms) ? "No Information Found" : PR.sms));
Console.WriteLine("Date Assigned: " + (string.IsNullOrEmpty(PR.AssignDate) ? "No Information Found" : PR.AssignDate));
Console.WriteLine("Telecom City: " + (string.IsNullOrEmpty(PR.TelecomCity) ? "No Information Found" : PR.TelecomCity));
Console.WriteLine("Telecom County: " + (string.IsNullOrEmpty(PR.TelecomCounty) ? "No Information Found" : PR.TelecomCounty));
Console.WriteLine("Telecom State: " + (string.IsNullOrEmpty(PR.TelecomState) ? "No Information Found" : PR.TelecomState));
Console.WriteLine("Telecom Zip: " + (string.IsNullOrEmpty(PR.TelecomZip) ? "No Information Found" : PR.TelecomZip));
Console.WriteLine("Time Zone: " + (string.IsNullOrEmpty(PR.TimeZone) ? "No Information Found" : PR.TimeZone));
Console.WriteLine("Latitude: " + (string.IsNullOrEmpty(PR.Lat) ? "No Information Found" : PR.Lat));
Console.WriteLine("Longitude: " + (string.IsNullOrEmpty(PR.Long) ? "No Information Found" : PR.Long));
Console.WriteLine("Wireless: " + PR.Wireless + "\n\n");
}
Console.ReadLine();
}
}
}
Personal tools
Namespaces

Variants
Actions
Navigation
Tools

Trial Key