Converted to ASCII, get the ASCII is 23 41 20 30 20 to 35 33 34 20 33 30
Could you tell me how to write, this function will
CodePudding user response:
Var bytes=Encoding. The ASCII. GetBytes (" # + 30 + space + A + Spaces 54 + space + 30 ");
CodePudding user response:
Var bytes=Encoding. The ASCII. 30 54 GetBytes ("=\ "# A 30");CodePudding user response:
Hexadecimal or decimal in no difference in the system, actually only 2 into the computer system, decimal, it takes the compiler under translation, computer can identify you as long as the final presentation into hexadecimalCodePudding user response:
To make a test is not clear?
Using System;
Using System. Linq;
Using System. The Text;
Static class Program
{
The static void Main ()
{
Byte [] bytes1=Encoding. The ASCII. GetBytes (" # A 30 54 30 ");
Byte [] bytes2=new byte [] {0 x23, 0 x41, 0 x20, 0 x33, 0 x30, 0 x20, 0 x35, 0 x34, 0 x20, 0 x33, 0 x30};
Var sequence exactly equal=bytes1. SequenceEqual (bytes2);
Console. WriteLine (sequence exactly equal);//true
}
}
CodePudding user response:
Why the above four master a also didn't help me make toIs converted to decimal two masters wrote before, what I need is converted to hexadecimal,
The third master is to help you master before wash white, hexadecimal, customers need to see what you told me to turn decimal computer it doesn't matter, I also think the key is the customer so I have to do
Fourth master, fully understand a mistake, he sent me directly with a serial port communication monitoring data for the judgment, the actual situation where I have these data,
But I will turn the data is not the four, but more than fifty, I just put up a few to do a story, then I added in the other,
CodePudding user response:
I need to enter a string, the output is the hexadecimal ASCII array, is BYTE form, because of the need to sent via a serial port to the cache areaCodePudding user response: