我怎么看到
所属论坛: .NET技术 C#
是不是bug
所属论坛: .NET技术 C#
是不是bug
解决方案 »
- 下面代码出现错误2非静态的字段、方法或属性“模糊.Program.Sort(int, int, double[*,*])”要求对象引用
- 关于DataList控件的Select,难道不是这样用的吗?
- C#关于任务栏隐藏窗体的方法
- 求一简单正则
- dll共享储存段的问题
- 实例化同一个对象,怎么分别控制
- 在C#中如何编写DLL,而在另一程序中又是调用它?请附源代码
- 如何让winform控件的背景色为透明
- SOS:含有Toolbar的页面嵌在Iframe中打开,此时Toolbar上的文本框无法使用复制、粘贴
- sqlDependency的onChange事件一直不停的触发,求解决方法
- 数据绑定的问题
- *********偶认为是人生的一大快事************
DirectoryEntry entry = new
DirectoryEntry("LDAP://dev.xxx.com");
try
{
DirectorySearcher search = new DirectorySearcher(entry);
search.Filter = "(SAMAccountName=administrator)";
search.PropertiesToLoad.Add("Name");
search.PropertiesToLoad.Add("displayName");
SearchResult result = search.FindOne();
if( result != null )
{
Console.WriteLine("User found");
foreach( string key in result.Properties.PropertyNames )
{
// Each property contains a collection of its own
// that may contain multiple values
foreach( Object propValue in result.Properties[key] )
{
Console.WriteLine(key + " = " + propValue);
}
}
}
else
{
Console.WriteLine("User not found");
}
}
catch( Exception ex )
{
throw new Exception("User not authenticated: " + ex.Message);
}
Console.ReadLine();