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);

           }

 


arrow
arrow
    創作者介紹
    創作者 倧齊 的頭像
    倧齊

    機車物語

    倧齊 發表在 痞客邦 留言(0) 人氣()