//
// using system;
// using system.io;
//
///
/// Temporary Storage.
/// summary>
PRIVATE STRING BUFFER;
///
///Write base64 string to temp storage.
/// summary>
Private void base64encode (String fromfile)
{
FILESTREAM FileStream = file.open (fromFile, FileMode.Open);
Byte [] buffer = new byte [fileStream.length];
FileStream.read (buffer, 0, buffer.length);
FileStream.close ();
THIS.BUFFER = Convert.TOBASE64String (Buffer);
}
///
/// read base64 string from temp storage and save to file.
/// summary>
Private void base64decode (String Tofile)
{
FILESTREAM FILESTREAM = New FileStream (Tofile, FileMode.create);
Byte [] buffer = convert.frombase64string (this.buffer);
FileStream.write (buffer, 0, buffer.length);
FileStream.close ();
}
///
/// Form Event.
/// summary>
/// param>
/// param>
Private void button1_click (Object Sender, Eventargs E)
{
THIS.BASE64ENCODE ("C: //Plastic.bmp")
}
///
/// Form Event.
/// summary>
/// param>
/// param>
Private void button2_click (Object Sender, Eventargs E)
{
THIS.BASE64DECode ("C: //tmp.bmp");
}