简体   繁体   English

C#AuthenticationTypes?

[英]C# AuthenticationTypes?

I came across the following line in a piece of code that uses Microsoft Active Directory: 我在使用Microsoft Active Directory的一段代码中遇到了以下一行:

const AuthenticationTypes ADS_EDMSERVER_BIND = (AuthenticationTypes)0x8000;

What exactly does this line mean ? 这条线到底是什么意思? Particularly, what is the 0x8000 mean ? 特别是0x8000是什么意思?

0x8000 is just a hexadecimal representation of integer 32768 . 0x8000只是整数32768的十六进制表示形式。 So this line of code essentially defines a constant of enumerable type AuthenticationTypes with a value of 32768 . 因此,此行代码本质上定义了一个值为32768的可枚举类型AuthenticationTypes的常量。 The number just specifies some AuthenticationTypes value or may be used as a mask in bit operations (eg | or &). 该数字仅指定一些AuthenticationTypes值,或者可以用作位操作(例如|或&)中的掩码。

Hexadecimal representations are sometimes used to improve readability or show relations to binary values (there is a nice discussion here ). 十六进制表示有时被用来提高可读性或显示关系二进制值(有一个很好的讨论, 在这里 )。 The simplest example is constants that are used in masks or with bit operators. 最简单的示例是在掩码中或与位运算符一起使用的常量。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM