SoftBasicHexStringToBytes 方法 |
命名空间: HslCommunication.BasicFramework
// str无论是下面哪种情况,都是等效的 string str = "13 A6 15 85 5B 05 12 36 F2 27"; //string str = "13-A6-15-85-5B-05-12-36-F2-27"; //string str = "13A615855B051236F227"; //string str = "13_A6_15_85_5B_05_12_36_F2_27"; byte[] b1 = SoftBasic.HexStringToBytes( str ); // b1 = new byte[] { 0x13, 0xA6, 0x15, 0x85, 0x5B, 0x05, 0x12, 0x36, 0xF2, 0x27 };