Simply Postcode Software .NET Assembly:
The .NET Assembly can be used with Micorsoft .NET, to quickly provide Postcode Address Lookup Software functionality and Nearest Store locator Ideal for Microsoft .NET C#, Microsoft .NET Visual Basic
Examples with full source code are included for Microsoft .NET C#, Microsoft .NET Visual Basic.
The .NET Assembly can also be used in "Local Mode", which means local data instead of our Web based data server. Ideal for .NET till solutions when no internet connection is possible or intermittent connection.
.NET Assembly Features:
The .NET Assembly has the following features:
- "Out of the box" Bespoke Desktop Postcode Address Search solution
- Quick and Simple to add Full Address Search, by using implemented User Interface
- Offers full access to all data we provide (Full/Thoroughfare/Geographic Longitude and Latitude)
- Offers Advanced Word Search (Wildcard) when using implemented User Interface
- Simply include .NET Assembly files in your application
- Can be included in your own install routines
- Data always up to date, when using our Web based data, as daily updates are applied
- No Data Administration Cost for you
- Can allow your customer to open an account, your get commission
- Can be run in local mode when internet is not available
Important: .NET Assembly is designed for
Desktop software. It will not work in IIS, since it
implements windows forms to provide Postcode Lookup
functionality. For External use, simply use our SOAP Web service.
.NET Assembly Example Code
The .NET Assembly examples:
For Desktop Software
| Directory | Language | API Used | Description |
|---|---|---|---|
| NET assembly/Csharp NET Assembly Example | C#.NET | .NET Assembly | Desktop app example for FULL (With advanced search), Thoroughfare/Street and PostZon Data |
| NET assembly/VB NET Assembly Example | VB.NET | .NET Assembly | Desktop app example for FULL (With advanced search), Thoroughfare/Street and PostZon Data |
Using the .NET Assembly
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.
How to distribute .NET Assembly
Simply include the “ISimplyPostCodeClass.dll” in your application directory.
Creating the .NET Assembly
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.
|
|
| 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 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); } |
Specify then Data Key
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_".
|
|
|
SimplyPostCodeLookup.SetDataKey(Me.txtDataKey.Text) |
|
|
| string DataKey="Your Data
Key"; SimplyPostCodeLookup.SetDataKey(ref DataKey); |
For more information, about the COM object to implement Postcode Finder Software, click on the link below:
Using the .NET Assembly in Local Mode
The .NET Assembly can also be used in "Local Mode", which means local data as apposed to Internet based data. Ideal for till solutions where no internet is available.
We recommend you use our web based address data for initial
testing. Then when happy download and install the local data
files
|
|
| SimplyPostCodeLookup.LMSetDataPath(“D:\MyApp”) |
|
|
| SimplyPostCodeLookup.LMSetDataPath(“D:\MyApp”); |
When in local mode the Datakey is irrelevant, since the license is defined by the code entered in manager.exe (License manager, located in "X:\PAFDATA" in the above example).
Additional files needed for local mode .NET Assembly
To use in local mode you need additional files to:
- Implement Postcode Address Finder Database.
- Allow the licenses to be unlocked
- Allow access to data files
For more information, about the .NET Assembly in Local mode, click on the link below:
Full Online API Reference Manual : .NET Assembly using Local Data
Getting Full address using the .Net Assembly User Interface
Simply call SearchForFullAddressWithDialogue(PostcodePrima, Caption, ShowLicienceDetails, AllowManageAccount, DisplayErrors)
This call can be used with Local Data or Internet based
data. But when using Local Data the advanced search is
not available.
This function call will display a dialogue box for the
user to enter the postcode to search for, or address words
if using Advanced Search (Web Based data only). The user then
presses the [FIND] button, and a list of possible addresses
is displayed for the entered postcode. The user selects an
appropriate address record and the address is returned.
Postcode Lookup Example:
This code displays the following Postcode Address Lookup window:
|
|
| 'Set Data key, to identify your
account SimplyPostCodeLookup.SetDataKey("Your Data Key") With SimplyPostCodeLookup If .SearchForFullAddressWithDialogue(Me.txtPostcode.Text, "Get address using simple call to .NET Assembly Object", True, True, True) Then Me.CompanyName.text = .Address_Organisation 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 End If End With |
|
|
| //Set Data key, to identify your
account string DataKey; DataKey = GetDataKey(); SimplyPostCodeLookup.SetDataKey(ref DataKey); //This calls the COM object to do all of the work! string PostCodeToFind = txtPostcode.Text; string Title = "Get address using simple call to .NET Assembly Object"; if (SimplyPostCodeLookup.SearchForFullAddressWithDialogue(PostCodeToFind, Title, true, true, true) == true) { CompanyName.text = SimplyPostCodeLookup.Address_Organisation; Line1.text = SimplyPostCodeLookup.Address_Line1; Line2.text = SimplyPostCodeLookup.Address_Line2; Line3.text = SimplyPostCodeLookup.Address_Line3; Town.text = SimplyPostCodeLookup.Address_Town; County.text = SimplyPostCodeLookup.Address_County; Postcode.text = SimplyPostCodeLookup.Address_Postcode; } |

Advanced Search Example:
This function adds an [Advanced Find] button to the search window provided by SearchForFullAddressWithDialogue call (See previous section). This allows users to enter address words to search for, to return Full address information:

When the [Advanced Find] button is pressed the following is displayed:

Results:

This call can ONLY be used with Internet
based data
For more information, about the .NET Assembly to implement Postcode Finder Software for bespoke desktop software, click on the link below:
Getting Thoroughfare/Street address using the .Net Assembly User Interface
Simply call 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.
Postcode Lookup Example:
This code gets the Thoroughfare/Street address information from the Royal Mail address database.
|
|
| '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 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; |
For more information, about the .NET Assembly to implement Postcode Finder Software for bespoke desktop software, click on the link below: