基本信息
源码名称:c# 使用Epplus存储Excel
源码大小:1.13M
文件格式:.zip
开发语言:C#
更新时间:2017-02-17
友情提示:(无需注册或充值,赞助后即可获取资源下载链接)
嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):78630559
本次赞助数额为: 2 元×
微信扫码支付:2 元
×
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
源码介绍
public static string HexToASCII(string Msg)
{
byte[] buff = new byte[Msg.Length / 2];
string Message = "";
for (int i = 0; i < buff.Length; i )
{
buff[i] = byte.Parse(Msg.Substring(i * 2, 2),
System.Globalization.NumberStyles.HexNumber);
}
System.Text.Encoding chs = System.Text.Encoding.ASCII;
Message = chs.GetString(buff);
return Message;
}
public static string HexToStr(string Msg)
{
byte[] buff = new byte[Msg.Length / 2];
string Message = "";
for (int i = 0; i < buff.Length; i )
{
buff[i] = byte.Parse(Msg.Substring(i * 2, 2),
System.Globalization.NumberStyles.HexNumber);
}
System.Text.Encoding chs = System.Text.Encoding.GetEncoding("gb2312");
Message = chs.GetString(buff);
return Message;
}
public static string StrToHex(string Msg)
{
byte[] bytes = System.Text.Encoding.Default.GetBytes(Msg);
string str = "";
for (int i = 0; i < bytes.Length; i )
{
str = string.Format("{0:X}", bytes[i]);
}
return str;
}