你能想象这样一张图片包含多少信息吗?
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.IO; using System.Linq; using System.Net; using System.Text; using System.Windows.Forms; namespace CreateQR { public partial class Form1 : Form { public Form1() { InitializeComponent(); } ///
private void SaveData(byte[] data) { SaveFileDialog saveFileDialog1 = new SaveFileDialog(); saveFileDialog1.Filter = "PNG格式图片|*.png"; saveFileDialog1.Title = "图片保存"; saveFileDialog1.ShowDialog(); if (saveFileDialog1.FileName != "") { if (File.Exists(saveFileDialog1.FileName)) { File.Delete(saveFileDialog1.FileName); } using (FileStream fs = File.Create(saveFileDialog1.FileName)) { fs.Write(data, 0, data.Length); } } } ///
///
private void DownloadData(string url, DownloadDataCompletedEventHandler dceh) { using (WebClient webClient = new WebClient()) { webClient.DownloadDataAsync(new Uri(url)); webClient.DownloadDataCompleted += dceh; }; } } }
文章最下面有全部源码以及demo 的下载地址
点我下载Demo
汤晓华 QQ 1881597 MSN [email protected]
2011 05 22
最新评论