Getting Thoroughfare/Street address using the .Net Assembly User Interface
Thoroughfare/Street Address Search functionality:
- Postcode is entered by user
- User presses Search button
- Address filled in apart from House Name and Number
- User manually types in House Name and Number, unlike Full Address
Step 1 Sign up for trial
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.
Step 2 Download .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.
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.
Step 3 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.
VB.Net |
Public Class Form1 |
C# .NET |
public partial class Form1 :
Form |
Step 4 Specify the 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_".
VB.Net |
SimplyPostCodeLookup.SetDataKey(Me.txtDataKey.Text) |
C# .NET |
string DataKey="Your Data
Key"; |
Optional, set Proxy sever details
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)
Parameters
Parameter name | Description |
---|---|
ProxyAddress As String | For example "http://proxy:80/" |
usedID As String | Username to log in to proxy |
Password As String | Password to log in to proxy |
Domain As String | Domain of proxy |
VB.Net |
'Set Proxy Server |
C# .NET |
'Set Proxy Server |
Step 5 Call GetThoroughfareAddressRecord to get address from postcode
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.
VB.Net |
'Set Data key, to identify
your account |
C# .NET |
//Set Data key, to identify your
account |
Step 6 Testing
Final step is to test, to enable easy testing please use our special test postcodes.
Thoroughfare/Street Address Search - Example Code
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 Thoroughfare/Street address data.
Data Returned:
This type of license returns: (see example below)
- Street Name
- Locality
- Town
- County
- Postcode
- Country "England","Wales","Northern Ireland","Isle of Man","Channel Islands","Scotland"
- Mail sort Code