Listing 1

using System;
using System.Collections.Generic;
using System.Text;
using System.Net.Sockets;
using System.Net;
using Microsoft.Win32;

namespace DotNetListner
{
 public class DotNetSocketListner
 {
     TcpListener server = null;

     int i = 0;

     public int portNumber;
     public int PortNumber
     {
         get {return portNumber;}
         set { portNumber = value; }

     }
     public string ipAddr;
     public string IPAddr
     {
         get { return ipAddr; }
         set { ipAddr = value; }
     }
     public string latitude;
     public string Latitude
     {
         get { return latitude; }

     }

     public string longitude;
     public string Longitude
     {
         get { return longitude; }
     }
 
     public void Initialize()
     {
         //parse our I.P. addres
         IPAddress localAddr = IPAddress.Parse(ipAddr);

         // TcpListener server = new TcpListener(port);
         server = new TcpListener(localAddr, portNumber);

         // Start listening for client requests.
         server.Start();

     }


     public void GetData()
     { 
             // Perform a blocking call to accept requests.
             TcpClient client = server.AcceptTcpClient();

             // Get a stream object for reading and writing
             NetworkStream stream = client.GetStream();

             System.IO.StreamReader streamReader = new System. 
              IO.StreamReader(stream);

             byte[] bytes = new byte[client.ReceiveBufferSize];

             // Read can return anything from 0 to numBytesToRead. 
             // This method blocks until at least one byte is read.
             stream.Read(bytes, 0, (int)client.ReceiveBufferSize);

             // Returns the data received from the host to the console.
             string returndata = Encoding.UTF8.GetString(bytes);

             //break up the string
             string[] parts = returndata.Split(new char[] { ',' });

             //set our properties
             latitude =  parts[0];
             longitude = parts[1];
     }
 }
}

Listing 2

OleObject loo_Location, loo_PinCurrentFix
OleObject findresults
OleObject Map

                if (IsNull(pushpin)) Then

                    pushpin.Delete();
 End If

                //parse out current lat/long
                map = ole_map.object.ActiveMap;
                loo_location = map.GetLocation(ab_lat, ab_long, 1);
                loo_location.GoTo();
                map.ZoomOut();
                pushpin = ole_map.object.ActiveMap.AddPushpin(loo_location, "You are here");

                pushpin.Select();

                //Now use the Map.ObjectsFromPoint method to get  
                  points from the above location
				  findresults =
				  \ ole_map.Object.ActiveMap.ObjectsFromPoint(ole_map.object.ActiveMap.LocationToX(loo_location),
				   ole_map.object.ActiveMap.LocationToY(loo_location));

Listing 3

$GPGGA,123519,4807.038,N,01131.000,E,1,08,0.9,545.4,M,46.9,M,,*47

Where:
     GGA          Global Positioning System Fix Data
     123519       Fix taken at 12:35:19 UTC
     4807.038,N   Latitude 48 deg 07.038' N
     01131.000,E  Longitude 11 deg 31.000' E
     1            Fix quality: 0 = invalid
                               1 = GPS fix (SPS)
                               2 = DGPS fix
                               3 = PPS fix
                               4 = Real Time Kinematic
                               5 = Float RTK
                               6 = estimated (dead reckoning) (2.3 feature)
                               7 = Manual input mode
                               8 = Simulation mode
     08           Number of satellites being tracked
     0.9          Horizontal dilution of position
     545.4,M      Altitude, Meters, above mean sea level
     46.9,M       Height of geoid (mean sea level) above WGS84
                      ellipsoid
     (empty field) time in seconds since last DGPS update
     (empty field) DGPS station ID number