Saturday, September 3, 2011

Google .NET


Great work is always appreciated, Google guys are doing very nice work by making their services available to programmers that can program in almost any language. One such example of Google being creating Client Libraries for .NET framework. More details are provided on actual Google Code Blog.
It is in its beta version, the sample code for URL shortener is as shown below:



// Create an instance of the UrlShortener-service. var service = new UrlshortenerService(); // Make a "Shorten URL" request. string urlToShorten = "http://maps.google.com/"; Url response =   service.Url.Insert(new Url { LongUrl = urlToShorten }).Fetch(); // Print the shortened url. string shortUrl = response.Id; Console.WriteLine(urlToShorten + " -> " + shortUrl);

Pawan Tejwani Creation