0

In PHP I can use this code:

$url = "http://maps.googleapis.com/maps/api/distancematrix/json?origins=$location1&      destinations=$location2&mode=bicycling&language=en-EN&sensor=false";       
        $data = @file_get_contents($url);       
        $obj = json_decode($data);        
        $arr = (array)$obj;

to get an array of values that return the distance between 2 locations.

Is this kind of web interaction possible with VSTO? I have Googled high and low and nothing I search is giving me any results to work with.

Ergo, I think I am missing something.

James Satori-Brunet
  • 901
  • 2
  • 13
  • 28
  • What language? `VB.NET`? `C#`? Have a look in this [Google Maps .NET API](http://gmaps.codeplex.com/), I think it could be helpful. – etaiso Apr 07 '14 at 07:56
  • OK, what about this one: http://stackoverflow.com/questions/20720172/getting-driving-distance-with-google-maps-api-and-ssis-package-in-c-sharp Read the accepted answer, it looks very similar to your goal. – etaiso Apr 07 '14 at 13:05
  • No, it didn't work at all. There are missing braces and overridden methods with the wrong return type. – James Satori-Brunet Apr 07 '14 at 14:48
  • How about this: http://stackoverflow.com/questions/18490599/parsing-json-rest-api-response-in-c-sharp – Mitja Bezenšek Apr 07 '14 at 14:58
  • No. That is about how to parse a JSON response, not how to get the response in the first place. – James Satori-Brunet Apr 08 '14 at 07:18
  • First lines are about getting response: client.BaseUrl = "https://api.cloud.appcelerator.com"; request.Resource = "/v1/chats/create.json?key=" + cac.AppCode.ToString(); request.Method = Method.POST; request.AddUrlSegment("appkey", "key"); var response = client.Execute(request); – Mitja Bezenšek Apr 08 '14 at 22:07

0 Answers0