Skip to content

Instantly share code, notes, and snippets.

@maxim75
Created July 5, 2011 07:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maxim75/1064422 to your computer and use it in GitHub Desktop.
Save maxim75/1064422 to your computer and use it in GitHub Desktop.
Bulk downloader for QR codes using Google Charts API
using System.Diagnostics;
using System.IO;
using System.Web;
namespace Qr
{
class Program
{
static void Main(string[] args)
{
var urls = new[] { "http://www.google.com", "http://www.domain.com.au", "http://www.yahoo.com.au" };
var i = 0;
foreach (var url in urls)
{
var objWebClient = new System.Net.WebClient();
var requestUrl = string.Format("http://chart.apis.google.com/chart?cht=qr&chs=150x150&chl={0}", HttpUtility.UrlEncode(url));
objWebClient.DownloadFile(requestUrl,
Path.Combine(new ProcessStartInfo().WorkingDirectory,
string.Format("a{0}.png", i++)));
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment