字符串转16进制数据
class Program
{
static void Main(string[] args)
{
string input = "Hello World!";
char[] values = input.ToCharArray();
foreach (char c in values)
{
int value = Convert.ToInt32(c);
Console.WriteLine("Hexadecimal value of {0} is {1:X}", c, value);
}
Console.ReadKey();
}
}
运行结果