VB.NET Example

From CDYNE Wiki
Jump to navigation Jump to search

Check Phone Number

 1 'http://ws.cdyne.com/phoneverify/phoneverify.asmx?wsdl was added as Web Reference and given the name WSDL
 2 
 3 Imports CheckPhoneNumber.WSDL
 4 Module Module1
 5 
 6     Sub Main()
 7 
 8         Dim PV As New PhoneVerify()
 9         Dim PR As New PhoneReturn()
10 
11         PR = PV.CheckPhoneNumber("17575449510", "YOUR LICENSE KEY")
12 
13         Console.WriteLine("Company: " & (If(String.IsNullOrEmpty(PR.Company), "No Information Found", PR.Company)))
14         Console.WriteLine("Valid: " & PR.Valid)
15         Console.WriteLine("Use: " & (If(String.IsNullOrEmpty(PR.Use), "No Information Found", PR.Use)))
16         Console.WriteLine("State: " & (If(String.IsNullOrEmpty(PR.State), "No Information Found", PR.State)))
17         Console.WriteLine("Switch: " & (If(String.IsNullOrEmpty(PR.Switch), "No Information Found", PR.Switch)))
18         Console.WriteLine("RC: " & (If(String.IsNullOrEmpty(PR.RC), "No Information Found", PR.RC)))
19         Console.WriteLine("OCN: " & (If(String.IsNullOrEmpty(PR.OCN), "No Information Found", PR.OCN)))
20         Console.WriteLine("Original Number: " & (If(String.IsNullOrEmpty(PR.OriginalNumber), "No Information Found", PR.OriginalNumber)))
21         Console.WriteLine("Clean Number: " & (If(String.IsNullOrEmpty(PR.CleanNumber), "No Information Found", PR.CleanNumber)))
22         Console.WriteLine("Switch Name: " & (If(String.IsNullOrEmpty(PR.SwitchName), "No Information Found", PR.SwitchName)))
23         Console.WriteLine("Switch Type: " & (If(String.IsNullOrEmpty(PR.SwitchType), "No Information Found", PR.SwitchType)))
24         Console.WriteLine("Country: " & (If(String.IsNullOrEmpty(PR.Country), "No Information Found", PR.Country)))
25         Console.WriteLine("CLLI: " & (If(String.IsNullOrEmpty(PR.CLLI), "No Information Found", PR.CLLI)))
26         Console.WriteLine("Prefix Type: " & (If(String.IsNullOrEmpty(PR.PrefixType), "No Information Found", PR.PrefixType)))
27         Console.WriteLine("LATA: " & (If(String.IsNullOrEmpty(PR.LATA), "No Information Found", PR.LATA)))
28         Console.WriteLine("SMS: " & (If(String.IsNullOrEmpty(PR.sms), "No Information Found", PR.sms)))
29         Console.WriteLine("Date Assigned: " & (If(String.IsNullOrEmpty(PR.AssignDate), "No Information Found", PR.AssignDate)))
30         Console.WriteLine("Telecom City: " & (If(String.IsNullOrEmpty(PR.TelecomCity), "No Information Found", PR.TelecomCity)))
31         Console.WriteLine("Telecom County: " & (If(String.IsNullOrEmpty(PR.TelecomCounty), "No Information Found", PR.TelecomCounty)))
32         Console.WriteLine("Telecom State: " & (If(String.IsNullOrEmpty(PR.TelecomState), "No Information Found", PR.TelecomState)))
33         Console.WriteLine("Telecom Zip: " & (If(String.IsNullOrEmpty(PR.TelecomZip), "No Information Found", PR.TelecomZip)))
34         Console.WriteLine("Time Zone: " & (If(String.IsNullOrEmpty(PR.TimeZone), "No Information Found", PR.TimeZone)))
35         Console.WriteLine("Latitude: " & (If(String.IsNullOrEmpty(PR.Lat), "No Information Found", PR.Lat)))
36         Console.WriteLine("Longitude: " & (If(String.IsNullOrEmpty(PR.Long), "No Information Found", PR.Long)))
37         Console.WriteLine("Wireless: " & PR.Wireless)
38 
39         Console.ReadLine()
40 
41     End Sub
42 
43 End Module

Check Phone Numbers

 1 'http://ws.cdyne.com/phoneverify/phoneverify.asmx?wsdl was added as Web Reference and given the name WSDL
 2 
 3 Imports CheckPhoneNumbers.WSDL
 4 Module Module1
 5 
 6     Sub Main()
 7 
 8         Dim PV As New PhoneVerify()
 9         Dim Numbers As Array
10 
11         Dim PhoneNumbers As String = "17575449510, 18009843710"
12         Dim PhoneNumbersArray() = PhoneNumbers.Split(",")
13         Const LicenseKey = "YOUR LICENSE KEY"
14 
15         Numbers = PV.CheckPhoneNumbers(PhoneNumbersArray, LicenseKey)
16 
17         For Each PR As WSDL.PhoneReturn In Numbers
18 
19             Console.WriteLine("Company: " & (If(String.IsNullOrEmpty(PR.Company), "No Information Found", PR.Company)))
20             Console.WriteLine("Valid: " & PR.Valid)
21             Console.WriteLine("Use: " & (If(String.IsNullOrEmpty(PR.Use), "No Information Found", PR.Use)))
22             Console.WriteLine("State: " & (If(String.IsNullOrEmpty(PR.State), "No Information Found", PR.State)))
23             Console.WriteLine("Switch: " & (If(String.IsNullOrEmpty(PR.Switch), "No Information Found", PR.Switch)))
24             Console.WriteLine("RC: " & (If(String.IsNullOrEmpty(PR.RC), "No Information Found", PR.RC)))
25             Console.WriteLine("OCN: " & (If(String.IsNullOrEmpty(PR.OCN), "No Information Found", PR.OCN)))
26             Console.WriteLine("Original Number: " & (If(String.IsNullOrEmpty(PR.OriginalNumber), "No Information Found", PR.OriginalNumber)))
27             Console.WriteLine("Clean Number: " & (If(String.IsNullOrEmpty(PR.CleanNumber), "No Information Found", PR.CleanNumber)))
28             Console.WriteLine("Switch Name: " & (If(String.IsNullOrEmpty(PR.SwitchName), "No Information Found", PR.SwitchName)))
29             Console.WriteLine("Switch Type: " & (If(String.IsNullOrEmpty(PR.SwitchType), "No Information Found", PR.SwitchType)))
30             Console.WriteLine("Country: " & (If(String.IsNullOrEmpty(PR.Country), "No Information Found", PR.Country)))
31             Console.WriteLine("CLLI: " & (If(String.IsNullOrEmpty(PR.CLLI), "No Information Found", PR.CLLI)))
32             Console.WriteLine("Prefix Type: " & (If(String.IsNullOrEmpty(PR.PrefixType), "No Information Found", PR.PrefixType)))
33             Console.WriteLine("LATA: " & (If(String.IsNullOrEmpty(PR.LATA), "No Information Found", PR.LATA)))
34             Console.WriteLine("SMS: " & (If(String.IsNullOrEmpty(PR.sms), "No Information Found", PR.sms)))
35             Console.WriteLine("Date Assigned: " & (If(String.IsNullOrEmpty(PR.AssignDate), "No Information Found", PR.AssignDate)))
36             Console.WriteLine("Telecom City: " & (If(String.IsNullOrEmpty(PR.TelecomCity), "No Information Found", PR.TelecomCity)))
37             Console.WriteLine("Telecom County: " & (If(String.IsNullOrEmpty(PR.TelecomCounty), "No Information Found", PR.TelecomCounty)))
38             Console.WriteLine("Telecom State: " & (If(String.IsNullOrEmpty(PR.TelecomState), "No Information Found", PR.TelecomState)))
39             Console.WriteLine("Telecom Zip: " & (If(String.IsNullOrEmpty(PR.TelecomZip), "No Information Found", PR.TelecomZip)))
40             Console.WriteLine("Time Zone: " & (If(String.IsNullOrEmpty(PR.TimeZone), "No Information Found", PR.TimeZone)))
41             Console.WriteLine("Latitude: " & (If(String.IsNullOrEmpty(PR.Lat), "No Information Found", PR.Lat)))
42             Console.WriteLine("Longitude: " & (If(String.IsNullOrEmpty(PR.Long), "No Information Found", PR.Long)))
43             Console.WriteLine("Wireless: " & PR.Wireless & Environment.NewLine & Environment.NewLine)
44         Next
45 
46         Console.ReadLine()
47 
48     End Sub
49 
50 End Module