活动目录数据类型...? [英] Active directory data types...?
本文介绍了活动目录数据类型...?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我正在尝试编写一个程序来显示AD中用户帐户的属性值.显然,字符串和整数只能显示为字符串,但是我一直在寻找一种首先确定数据类型的方法,以便可以将其转换为字符串-例如大整数,八位字节字符串UTC时间等.
关于如何查询数据类型的任何想法?
非常感谢,
Phil
Hi Guys,
I’m trying to write a programme that will show the values of attributes of user’s accounts in AD. Obviously strings and ints can just be shown as a string but i was looking for a way to determine the datatype first so it could be converted into a string - such as a large integer, octet string UTC time etc.
Any ideas on how i can query for the datatype?
Many Thanks,
Phil
推荐答案
所有对象都具有.GetType()函数,该函数返回Type类,然后按类型返回.
也许这可以帮助吗?
方法:(几乎)通过C#将Active Directory中的所有内容 [
All object has the .GetType() function, that returns a Type class and there by the type.
Perhaps this can help ?
Howto: (Almost) Everything In Active Directory via C#[^]
Try take a look at TypeDescriptor class and the function GetConverter and ConvertToString.
金,
那行不通,但我想我已经找到了自己的答案:
Hi Kim,
that doesn''t work, but i think i have found my own answer:
ActiveDirectorySchema ass = ActiveDirectorySchema.GetCurrentSchema();
ActiveDirectorySchemaClass u = ass.FindClass("person");
foreach (ActiveDirectorySchemaProperty a in u.GetAllProperties())
{
Console.WriteLine(a.CommonName + " : " + a.Syntax);
}
我需要语法",这样我才能知道如何转换数据.
感谢您的帮助
菲尔
i needed the "Syntax" so i could then know how to convert the data.
thank for your help
Phil
这篇关于活动目录数据类型...?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文