[Csharp] string str = "test"; // convert string to byte [] Strbyte = System. text. encoding. default. getBytes (str); // convert byte to string tempStr = System. text. encoding. default. getString (Strbyte); // convert image to byte FileStream fs = new FileStream (@ "R: \ Engineer Training \ Intern Training \ Chao \ pic \ 1.png", FileMode. open); byte [] imageByte = new byte [fs. length]; fs. read (imageByte, 0, imageByte. length); fs. close (); # region image to byte (2) byte [] photo_byte = null; using (FileStream fs2 = new FileStream (@ "R: \ Engineer Training \ Intern Training \ Chao \ pic \ 1.png", FileMode. open, FileAccess. read) {using (BinaryReader br = new BinaryReader (fs2) {photo_byte = br. readBytes (int) fs2.Length) ;}# endregion // byte to image MemoryStream MS = new MemoryStream (imageByte); Image photo = Image. fromStream (MS, true); # region byte to image (2) Image photo2 = null; using (MemoryStream ms2 = new MemoryStream (imageByte) {ms2.Write (imageByte, 0, imageByte. length); photo2 = Image. fromStream (ms2, true) ;}# endregion photo. save (@ "R: \ Engineer Training \ Intern Training \ Chao \ pic \ 3.jpg ");