7.Add a reference to the MapPoint API by
findService.PreAuthenticate = TrueDim findSpec As New FindSpecificationfindSpec.DataSourceName = MapPoint.NA specify and obtain details for the starting addressfindSpec.InputPlace = txtStartingAddress.TextDim StartingAddress As FindResults = findService.Find(findSpec) specify and obtain details for the ending addressfindSpec.InputPlace = txtEndingAddress.TextDim EndingAddress As FindResults = findService.Find(findSpec) specify the route segment detailsDim rteSegmentSpec(1) As SegmentSpecificationrteSegmentSpec(0) = New SegmentSpecificationrteSegmentSpec(0).Waypoint = New WaypointrteSegmentSpec(0).Waypoint.Name = _ StartingAddress.Results(0).FoundLocation.Entity.NamerteSegmentSpec(0).Waypoint.Location = _ StartingAddress.Results(0).FoundLocationrteSegmentSpec(1) = New SegmentSpecificationrteSegmentSpec(1).Waypoint = New WaypointrteSegmentSpec(1).Waypoint.Name = _ EndingAddress.Results(0).FoundLocation.Entity.NamerteSegmentSpec(1).Waypoint.Location = _ EndingAddress.Results(0).FoundLocation specify the route specification detailsDim routeSpec As New RouteSpecificationrouteSpec.DataSourceName = MapPoint.NA routeSpec.Segments = rteSegmentSpec Specify the credentials for the route service Use the customer id and password you were providedDim routeService As New RouteServiceSoaprouteService.Credentials = New _ System.Net.NetworkCredential( YOUR CUSTOMER ID , YOUR PASSWORD ) routeService.PreAuthenticate = True call the calculate route method to retrieve the routeDim Route As RouteRoute = routeService.CalculateRoute(routeSpec) Dim intCount As IntegerDim strResults As String loop through the results returnedFor intCount = 0 To Route.Itinerary.Segments(0).Directions.Length - 1strResults = strResults & _ Route.Itinerary.Segments(0).Directions(intCount).Instruction & vbCrLfNext intCount display the resultstxtResults.Text = strResultsEnd Sub187Calling
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Mac Web Hosting services