if (this.openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
var b = new byte[this.openFileDialog1.OpenFile().Length];
var buffer = new byte[this.openFileDialog1.OpenFile().Length];
this.openFileDialog1.OpenFile().Read(buffer, 0, (int)this.openFileDialog1.OpenFile().Length);
string base64String = Convert.ToBase64String(buffer);
string ImgBase64 = string.Format("<img src='data:image/png;base64,{0}' alt='' />", base64String);
this.textBox1.Text = ImgBase64;
Clipboard.SetData(DataFormats.Text, ImgBase64);
}
留言列表