惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Project Zero
Project Zero
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Scott Helme
Scott Helme
Know Your Adversary
Know Your Adversary
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
WordPress大学
WordPress大学
AWS News Blog
AWS News Blog
小众软件
小众软件
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Jina AI
Jina AI
AI
AI
美团技术团队
人人都是产品经理
人人都是产品经理
S
Secure Thoughts
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
Visual Studio Blog
宝玉的分享
宝玉的分享
Security Latest
Security Latest
P
Privacy & Cybersecurity Law Blog
C
Cisco Blogs
大猫的无限游戏
大猫的无限游戏
Google Online Security Blog
Google Online Security Blog
L
LINUX DO - 最新话题
罗磊的独立博客
Recent Announcements
Recent Announcements
H
Hacker News: Front Page
博客园 - 【当耐特】
K
Kaspersky official blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
SecWiki News
SecWiki News
Schneier on Security
Schneier on Security
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Apple Machine Learning Research
Apple Machine Learning Research
F
Full Disclosure
Google DeepMind News
Google DeepMind News
V
V2EX
博客园 - 聂微东
量子位
云风的 BLOG
云风的 BLOG
C
Check Point Blog
J
Java Code Geeks
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
W
WeLiveSecurity
Engineering at Meta
Engineering at Meta
V2EX - 技术
V2EX - 技术
Vercel News
Vercel News
L
LINUX DO - 热门话题
T
The Exploit Database - CXSecurity.com
L
Lohrmann on Cybersecurity
The GitHub Blog
The GitHub Blog

博客园 - 沸石

快速压缩log文件 SQL Server-拆分字符串返回表(存储过程) ASHX 生成excel文件 SQL Server-动态Pivot表的存储过程 突破AD查询1000条限制(转) 轻松创建运行命令 (转) (转)Resolving errors creating a Strong Name Key 以动词开头的习惯搭配:转 枚举的遍历和字符串转枚举,枚举转字符串 转 - 沸石 - 博客园 (转)英语信件中最常用精选句式 控件命名 转:C#委托及事件 转:关于HttpHandlers和HttpModules的不同 js:scrollLeft,scrollWidth,clientWidth,offsetWidth完全详解 商业书信英语-常用结束语 SQL中合并多行记录的方法总汇 C# 中的字符串函数及应用举例(转) 英文函电书写基本原则 SQL Server 2005之PIVOT/UNPIVOT行列转换
转:YetAnotherForum集成AD用户混合登录(一) AD验证类 - 沸石 - 博客园
沸石 · 2009-04-10 · via 博客园 - 沸石

YetAnotherForum集成AD用户混合登录(一) AD验证类

 public class AD_pass
{
private string _path;
private string _filterAttribute;
public AD_pass()
{

_path

= "LDAP://DC=office,DC=local";

}

public bool IsAuthenticated(string username, string pwd)
{

try
{
DirectoryEntry entry

= new DirectoryEntry(_path, username, pwd);

Object obj

= entry.NativeObject;
DirectorySearcher search
= new DirectorySearcher(entry);
search.Filter
= "(SAMAccountName=" + username + ")";
SearchResult result
= search.FindOne();
if (null == result)
{
return false;
}
_path
= result.Path;
_filterAttribute
= (String)result.Properties["cn"][0];
}
catch (Exception ex)
{
return false;
}
return true;
}
}