Robert Chu
08-01-2006, 08:03 AM
Hello,
The following code shows an error message like: Name 'DirectoryEntry' is not declared. How can I fix it ?
<%@ Import Namespace="System.DirectoryServices" %>
<html>
<head>
<title>ad</title>
<script language="VB" runat="Server">
Sub Page_Load(Sender As Object, e As Eventargs)
DirectoryEntry entry = new DirectoryEntry(LDAP://SOUTHDOCTOR,"lkk","lkk");
<PRE lang=cs>DirectorySearcher mySearcher = new DirectorySearcher(entry);
SearchResultCollection results;
mySearcher.Filter ("cn=rcc");
results = mySearcher.FindAll();
foreach(SearchResult resEnt in results)
{
ResultPropertyCollection propcoll=resEnt.Properties;
foreach(string key in propcoll.PropertyNames)
{
foreach(object values in propcoll[key])
{
//name and value collection retrival
}
}
}
End Sub
</script>
</head>
<body>
<h3>請輸入使用者資料 - SQL指令</h3>
</body>
</html>
The following code shows an error message like: Name 'DirectoryEntry' is not declared. How can I fix it ?
<%@ Import Namespace="System.DirectoryServices" %>
<html>
<head>
<title>ad</title>
<script language="VB" runat="Server">
Sub Page_Load(Sender As Object, e As Eventargs)
DirectoryEntry entry = new DirectoryEntry(LDAP://SOUTHDOCTOR,"lkk","lkk");
<PRE lang=cs>DirectorySearcher mySearcher = new DirectorySearcher(entry);
SearchResultCollection results;
mySearcher.Filter ("cn=rcc");
results = mySearcher.FindAll();
foreach(SearchResult resEnt in results)
{
ResultPropertyCollection propcoll=resEnt.Properties;
foreach(string key in propcoll.PropertyNames)
{
foreach(object values in propcoll[key])
{
//name and value collection retrival
}
}
}
End Sub
</script>
</head>
<body>
<h3>請輸入使用者資料 - SQL指令</h3>
</body>
</html>