Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Active Directory で値を設定するために、AD プロパティに割り当てるために long を符号なし 8 バイト整数に変換したいと考えています。
これどうやってするの?
long が負の場合、単純なキャストで問題が発生する可能性があり、OverflowException が発生する可能性があります。unchecked構文を使用して、正しくキャストされるようにする必要があります。
ulong myUnsignedValue = unchecked( (ulong)originalLongValue );
を にキャストlongしulongます。
long
ulong
詳細はこちら。