Street Address Search functionality
Simply use the "Sign Up for Trial" link at top right of this page to open a trial account. We will then send you a data key, which is used to identify your account, when using the following service.
The .NET Assembly is for use with any Desktop .NET project. It is written in Framework V2.0 so compatible with any framework from 2 upwards. It is almost identical to our COM object, but is implemented as a .NET Assembly. It is therefore easier to distribute within your .NET project, since it requires no extra files.
The .NET Assembly is in the “NET Assembly” directory of our example code.
Simply include the “ISimplyPostCodeClass.dll” in your application directory.
Note: the .Net Assembly is for desktop applications compiled to 32 bits. It will run fine on 64 bit machines, but will not support an application compiled to 64 bits, as it uses Microsoft MDAC which does not support 64 bits.
Copy the “ISimplyPostCodeClass.dll” in your application directory, and then add it to your project references. This can be found in the “NET Assembly” directory of our example code.
In C# or VB, simply right click on the project in the Solution Explorer. Select “Add Reference”. On the window that opens, click on the Browser tab. Now find and double click on “ISimplyPostCodeClass.dll” to add reference.
The class constructor takes a parameter of a working directory PATH. This directory is used to store the advanced search data used in combos if used. This must be a valid directory, and have WRITE permissions.
VB.NET Public Class Form1 Public SimplyPostCodeLookup As ISimplyPostCodeClass.ISimplyPostCodeClass Private Sub Form1_Disposed(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Disposed SimplyPostCodeLookup = Nothing End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load SimplyPostCodeLookup = New ISimplyPostCodeClass.ISimplyPostCodeClass(CurDir)
Public Class Form1 Public SimplyPostCodeLookup As ISimplyPostCodeClass.ISimplyPostCodeClass Private Sub Form1_Disposed(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Disposed SimplyPostCodeLookup = Nothing End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load SimplyPostCodeLookup = New ISimplyPostCodeClass.ISimplyPostCodeClass(CurDir)
C# .NET public partial class Form1 : Form private ISimplyPostCodeClass.ISimplyPostCodeClass SimplyPostCodeLookup; private void Form1_Load(object sender, EventArgs e) string workingDirectoryForWorkingFiles = Directory.GetCurrentDirectory(); SimplyPostCodeLookup = new ISimplyPostCodeClass.ISimplyPostCodeClass(workingDirectoryForWorkingFiles); }
public partial class Form1 : Form private ISimplyPostCodeClass.ISimplyPostCodeClass SimplyPostCodeLookup; private void Form1_Load(object sender, EventArgs e) string workingDirectoryForWorkingFiles = Directory.GetCurrentDirectory(); SimplyPostCodeLookup = new ISimplyPostCodeClass.ISimplyPostCodeClass(workingDirectoryForWorkingFiles); }
The Data Key will have been sent to you via an e-mail when you opened the account. It is also available under the “Data Key” tab of the online admin window. For the .NET Assembly you should use the data key beginning with "I_".
VB.NET SimplyPostCodeLookup.SetDataKey(Me.txtDataKey.Text)
SimplyPostCodeLookup.SetDataKey(Me.txtDataKey.Text)
C# .NET SimplyPostCodeLookup.SetDataKey(ref DataKey);
SimplyPostCodeLookup.SetDataKey(ref DataKey);
A function allows the program to define the proxy settings touse when requesting data from our internet server.
Simply call SetProxy(ProxyAddress, usedID, Password, Domain)
SetProxy(ProxyAddress, usedID, Password, Domain)
VB.NET 'Set Proxy Server SimplyPostCodeLookup. SetProxy(”https://proxy:80/”,”Admin”,”Password”,”My Domain”)
'Set Proxy Server SimplyPostCodeLookup. SetProxy(”https://proxy:80/”,”Admin”,”Password”,”My Domain”)
C# .NET 'Set Proxy Server SimplyPostCodeLookup. SetProxy(”https://proxy:80/”,”Admin”,”Password”,”My Domain”);
'Set Proxy Server SimplyPostCodeLookup. SetProxy(”https://proxy:80/”,”Admin”,”Password”,”My Domain”);
Simply call GetThoroughfareAddressRecord(Postcode) as Boolean
GetThoroughfareAddressRecord(Postcode) as Boolean
This type of search will get most of the address, except the house name or number. The user then must enter this information themselves.
This call can be used with Local Data or Internet based data.
Simply call with the postcode to search for.
This code gets the Street address information from the Royal Mail address database.
VB.NET 'Set Data key, to identify your account SimplyPostCodeLookup.SetDataKey("Your Data Key") With SimplyPostCodeLookup If .GetThoroughfareAddressRecord(Me.txtPostcode.Text) Then Me.Line1.text = .Address_Line1 Me.Line2.text = .Address_Line2 Me.Line3.text = .Address_Line3 Me.Town.text = .Address_Town Me.County.text = .Address_County Me.Postcode.text = .Address_Postcode Else If .General_errormessage <> "" Then MsgBox(.General_credits_display_text & vbCrLf & .General_errormessage, vbCritical, "Simply Postcode Lookup") Else MsgBox("Not found!") End If End If Me.Text = "Simply Postcode Lookup : " & .General_credits_display_text End With
'Set Data key, to identify your account SimplyPostCodeLookup.SetDataKey("Your Data Key") With SimplyPostCodeLookup If .GetThoroughfareAddressRecord(Me.txtPostcode.Text) Then Me.Line1.text = .Address_Line1 Me.Line2.text = .Address_Line2 Me.Line3.text = .Address_Line3 Me.Town.text = .Address_Town Me.County.text = .Address_County Me.Postcode.text = .Address_Postcode Else If .General_errormessage <> "" Then MsgBox(.General_credits_display_text & vbCrLf & .General_errormessage, vbCritical, "Simply Postcode Lookup") Else MsgBox("Not found!") End If End If Me.Text = "Simply Postcode Lookup : " & .General_credits_display_text End With
C# .NET //Set Data key, to identify your account string DataKey= ""; string DataToShow= ""; string crlf = "\r\n"; DataKey = GetDataKey(); SimplyPostCodeLookup.SetDataKey(DataKey); string PostCodeToFind=txtPostcode.Text; if (SimplyPostCodeLookup.GetThoroughfareAddressRecord(PostCodeToFind) == true) { DataToShow = " line1 : " + SimplyPostCodeLookup.Address_Line1 + crlf; DataToShow = DataToShow + " line2 : " + SimplyPostCodeLookup.Address_Line2 + crlf; DataToShow = DataToShow + " line3 : " + SimplyPostCodeLookup.Address_Line3 + crlf; DataToShow = DataToShow + " town : " + SimplyPostCodeLookup.Address_Town + crlf; DataToShow = DataToShow + " county : " + SimplyPostCodeLookup.Address_County + crlf; DataToShow = DataToShow + " postcode : " + SimplyPostCodeLookup.Address_Postcode + crlf; //If low credit then can display button to buy more Credits/Licenses //This is optional, but it is recommended to provide some means for the end //Customer to purchase new Credits/Licenses from Simply Postcode Lookup Direct if (SimplyPostCodeLookup.General_credits_display_showbutton==true) { ButtonBuyMore.Visible = true; } else { ButtonBuyMore.Visible = false; } } else { if (SimplyPostCodeLookup.General_errormessage != "" ) { MessageBox.Show(SimplyPostCodeLookup.General_credits_display_text+" "+ SimplyPostCodeLookup.General_errormessage, "Simply Postcode Lookup"); } else { MessageBox.Show("Not found!"); } } this.Text = "Simply Postcode Lookup : " + SimplyPostCodeLookup.General_credits_display_text;
//Set Data key, to identify your account string DataKey= ""; string DataToShow= ""; string crlf = "\r\n"; DataKey = GetDataKey(); SimplyPostCodeLookup.SetDataKey(DataKey); string PostCodeToFind=txtPostcode.Text; if (SimplyPostCodeLookup.GetThoroughfareAddressRecord(PostCodeToFind) == true) { DataToShow = " line1 : " + SimplyPostCodeLookup.Address_Line1 + crlf; DataToShow = DataToShow + " line2 : " + SimplyPostCodeLookup.Address_Line2 + crlf; DataToShow = DataToShow + " line3 : " + SimplyPostCodeLookup.Address_Line3 + crlf; DataToShow = DataToShow + " town : " + SimplyPostCodeLookup.Address_Town + crlf; DataToShow = DataToShow + " county : " + SimplyPostCodeLookup.Address_County + crlf; DataToShow = DataToShow + " postcode : " + SimplyPostCodeLookup.Address_Postcode + crlf; //If low credit then can display button to buy more Credits/Licenses //This is optional, but it is recommended to provide some means for the end //Customer to purchase new Credits/Licenses from Simply Postcode Lookup Direct if (SimplyPostCodeLookup.General_credits_display_showbutton==true) { ButtonBuyMore.Visible = true; } else { ButtonBuyMore.Visible = false; } } else { if (SimplyPostCodeLookup.General_errormessage != "" ) { MessageBox.Show(SimplyPostCodeLookup.General_credits_display_text+" "+ SimplyPostCodeLookup.General_errormessage, "Simply Postcode Lookup"); } else { MessageBox.Show("Not found!"); } } this.Text = "Simply Postcode Lookup : " + SimplyPostCodeLookup.General_credits_display_text;
Final step is to test, to enable easy testing please use our special test postcodes.
Simply download the example code. The code is in the "NET assembly/Csharp NET Assembly Example" or "NET assembly/VB NET Assembly Example" directory of our example downloads.
These two examples demonstrate postcode lookup software using Street address data.
This type of license returns: (see example below)