111,096
社区成员




你先弄清楚你的hex是什么格式的吧。。一般是intel hex,但程序员里什么样的逗逼都有,所以也可能是某个逗逼自己发明的格式。。。
二进制转十六进制即可
一般的话你的文件都是accii编码的 用这个没错
#region 读文件
/****************************************
* 函数名称:ReadFile
* 功能说明:读取文本内容
* 参 数:Path:文件路径
* 调用示列:
* string Path = Server.MapPath("Default2.aspx");
* string s = DotNet.Utilities.FileOperate.ReadFile(Path);
*****************************************/
/// <summary>
/// 读文件
/// </summary>
/// <param name="Path">文件路径</param>
/// <returns></returns>
public static string ReadFile(string Path)
{
string s = "";
if (!System.IO.File.Exists(Path))
s = "不存在相应的目录";
else
{
StreamReader f2 = new StreamReader(Path, System.Text.Encoding.GetEncoding("gb2312"));
s = f2.ReadToEnd();
f2.Close();
f2.Dispose();
}
return s;
}
#endregion
一般的话你的文件都是accii编码的 用这个没错