/// <summary> /// 编码二进制数据为字符串 /// </summary> /// <param name="filePath">数据文件</param> /// <returns>编码后的字符串</returns> public static string EncodingFile(string filePath) { //(A ~ Z),算法:sourceByte => firstByte = (byte 右移 4) + 65 和 lastByte = (byte&(byte)15) + 65 using (FileStream fs = new FileStream(filePath, FileMode.Open, FileAccess.Read)) { byte[] buffer = new byte[fs.Length]; fs.Read(buffer, 0, buffer.Length); return(FileStringCodingEx.EncodingBytes(buffer)); } }