示例#1
0
        public void Test2()
        {
            byte[] buffer = { 0x20, 0x46, 0x47, 0x45, 0x4e, 0x44, 0x4a, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x41, 0x41, 0x00 };
            int    offset = 0;
            string name   = NetBiosUtils.DecodeName(buffer, ref offset);

            byte[] encodedName = NetBiosUtils.EncodeName(name, string.Empty);
            Assert.True(ByteUtils.AreByteArraysEqual(buffer, encodedName));
        }
示例#2
0
        public static void Test2()
        {
            byte[] buffer = new byte[] { 0x20, 0x46, 0x47, 0x45, 0x4e, 0x44, 0x4a, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x41, 0x41, 0x00 };
            int    offset = 0;
            string name   = NetBiosUtils.DecodeName(buffer, ref offset);

            byte[] encodedName = NetBiosUtils.EncodeName(name, String.Empty);
            bool   success     = ByteUtils.AreByteArraysEqual(buffer, encodedName);
        }