lenya
3/23/2018 - 12:56 AM

使用Google API生成QR码

使用Google API生成QR码

const string GoogleChartApiPrefix = "http://chart.apis.google.com/chart?cht=qr&chs=100x100&chl=";

[Test]
public void DownloadFile()
{
WebClient wc = new WebClient();
string content = "测试";
string url = GoogleChartApiPrefix + HttpUtility.UrlEncode(content);
wc.DownloadFile(url, string.Format("e:\\{0}.jpeg", content));

}