Do you means that you need to get the route based on the locations. If so, please try the following steps:
Use the "Routing Index Generator" tools(you can download it from here) to build the routable files.
Create the Routing Engine by the files created in the #1. As shown below:
ShapeFileFeatureSource featureSource = new shapeFileFeatureSource("XXX.shp");
RtgRoutingSource routingSource = new RtgRoutingSource("XXX.rtg");
RoutingEngine routingEngine = new RoutingEngine(routingSource, featureSource);
Open the Routing Engine.
Call the method GetRoute of Routing Engine as below:
routingResult = routingEngine.GetRoute(routingLayer.StartPoint, routingLayer.EndPoint, routingLayer.StopPoints);
And then we can access the routingResult.Rout.Vetices property to get the all coordinates.
More information please refer to:
If something misunderstood here please provide more information about your real scenario.