You can either use Pythagoras on each line segment and sum them up if your coordinate system is "flat", or use Vicenty's formula on the line segments if your coordinates are spherical (ie longitude/latitude). Or lastly you could use the Geometry service: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#Lengths