記錄下。。唉。。。。
java代碼:
導入這個 commons-codec-1.8.jar (下載鏈接: http://files.cnblogs.com/files/gaocong/jar%E5%8C%85.rar)
java后台方法 InputStream in = null; byte[] data = null; //讀取圖片字節數組 try { in = new FileInputStream(imgFilePath); data = new byte[in.available()]; in.read(data); in.close(); } catch (IOException e) { e.printStackTrace(); } //對字節數組Base64編碼 return new String(Base64.encodeBase64(data));//返回Base64編碼過的字節數組字符串
然后在c#中解碼
//字符串轉流 byte[] bt = Convert.FromBase64String(m_l.BinaryImg);