473,657 Members | 2,378 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DirectoryServic es Problem

Hi All....

I'm having a HECK of a time connecting to Active Directory using VB in
Visual Studio.NET 2003. Can anyone PLEASE help me?

All I am trying to do is list the current members of our Active Directory on
a web page. If I can connect to the AD interfaces, then I think I can
handle it from there.

I do have a VS.NET C# project successfully working and enumerating names,
but can NOT for the life of me get VB to work with AD.

I originally tried to do it outside of VS.NET, but ran into problems trying
to reference the System.Director yServices namespace unless I compiled the
project inside VS.NET. I did make an earlier post to this group about this
issue, and though the recommendations I received were insightful, they did
not work (neither precompiling, nor including a direct reference to the .dll
in the Page directive worked). I was finally able to import the name space
by copying the dll to the application's /bin directory. But why would I
want to make a copy of it when it already exists on the system? So what
happened to being able to build .NET applications with just a text editor???

So I decided to try a walkthrough of MS Knowledge Base article # 326340
(http://support.microsoft.com/default...0&Product=aspn
et). I followed it to the letter, and when I try to build the project in
VS.NET, I get compilation errors in the .vb file I cut and pasted directly
from the article!!!! The three errors are all in the LdapAuthenticat ion.vb
file:

E:\inetpub\Auth Test\LdapAuthen tication.vb(19) : Array bounds cannot appear in
type specifiers.
E:\inetpub\Auth Test\LdapAuthen tication.vb(23) : Name 'entry' is not declared.
E:\inetpub\Auth Test\LdapAuthen tication.vb(24) : Name 'entry' is not declared.

So.... if anyone can PLEASE HELP me get going here (I'm almost hoping one of
you can confirm my install is pooched, otherwise I have no idea why it does
not like the instructions as entered according to MS)

Again, all I need to do is connect to AD from a Web Page and list all the
users (Intranet site only).

Thanks in advance!

Keith C. Jakobs, MCP
Nov 21 '05 #1
5 2060
I guess a little more details on the errors would be useful....
E:\inetpub\Auth Test\LdapAuthen tication.vb(19) : Array bounds cannot appear in
type specifiers. (refers to '_path' in):
Dim entry As DirectoryEntry( _path, domainAndUserna me, pwd)
E:\inetpub\Auth Test\LdapAuthen tication.vb(23) : Name 'entry' is not declared. refers to:
Dim obj As Object = entry.NativeObj ect

and E:\inetpub\Auth Test\LdapAuthen tication.vb(24) : Name 'entry' is not

declared. refers to:
Dim search As DirectorySearch er = New DirectorySearch er(entry)

Which completely confuses me because 'entry' is deinfed in the first error
line, and a statement taken from MS instructions!!! !

..NET is soooo damn confusing. Please Help!
Thanks again!

Keith C. Jakobs, MCP

Nov 21 '05 #2
I do not have System.Director yServices.dll copied to my bin folder (copy
local=false), but I do have it referenced in VS.

Here is the AD code I am using in a web app, with no problems. Might want to
try this little function out and see if you can get it to work. Make sure
your virtual directory has anonymous access turned off.

Greg

Imports System.Director yServices
Public Class MyFunctions
Public Shared Function GetFullName(ByV al UserName As String) As String
Const DomainName As String = "mydomain.c om"

Dim oDirectory As New DirectoryEntry( "LDAP://" & DomainName)
Dim mySearcher As New DirectorySearch er(oDirectory)
Dim oResult As SearchResult
Dim sResult As String
mySearcher.Sear chScope = SearchScope.Sub tree
mySearcher.Refe rralChasing = ReferralChasing Option.All
mySearcher.Filt er = "(&(objectClass =user)(sAMAccou ntName=" &
UserName & "))"

Try
oResult = mySearcher.Find One
If Not oResult Is Nothing Then
sResult =
oResult.GetDire ctoryEntry.Prop erties("Display Name").Value.To String()
End If
Catch ex As Exception
Throw ex
End Try

oResult = Nothing
mySearcher.Disp ose()
oDirectory.Disp ose()

Return sResult
End Function
End Class

"Keith Jakobs, MCP" <el****@NOSPAM. hotmail.com> wrote in message
news:uC******** *******@TK2MSFT NGP12.phx.gbl.. .
Hi All....

I'm having a HECK of a time connecting to Active Directory using VB in
Visual Studio.NET 2003. Can anyone PLEASE help me?

All I am trying to do is list the current members of our Active Directory on a web page. If I can connect to the AD interfaces, then I think I can
handle it from there.

I do have a VS.NET C# project successfully working and enumerating names,
but can NOT for the life of me get VB to work with AD.

I originally tried to do it outside of VS.NET, but ran into problems trying to reference the System.Director yServices namespace unless I compiled the
project inside VS.NET. I did make an earlier post to this group about this issue, and though the recommendations I received were insightful, they did
not work (neither precompiling, nor including a direct reference to the ..dll in the Page directive worked). I was finally able to import the name space by copying the dll to the application's /bin directory. But why would I
want to make a copy of it when it already exists on the system? So what
happened to being able to build .NET applications with just a text editor???
So I decided to try a walkthrough of MS Knowledge Base article # 326340
(http://support.microsoft.com/default...0&Product=aspn et). I followed it to the letter, and when I try to build the project in
VS.NET, I get compilation errors in the .vb file I cut and pasted directly
from the article!!!! The three errors are all in the LdapAuthenticat ion.vb file:

E:\inetpub\Auth Test\LdapAuthen tication.vb(19) : Array bounds cannot appear in type specifiers.
E:\inetpub\Auth Test\LdapAuthen tication.vb(23) : Name 'entry' is not declared. E:\inetpub\Auth Test\LdapAuthen tication.vb(24) : Name 'entry' is not declared.
So.... if anyone can PLEASE HELP me get going here (I'm almost hoping one of you can confirm my install is pooched, otherwise I have no idea why it does not like the instructions as entered according to MS)

Again, all I need to do is connect to AD from a Web Page and list all the
users (Intranet site only).

Thanks in advance!

Keith C. Jakobs, MCP

Nov 21 '05 #3
Hi Greg,

Thanks so much for your response and sample code. Though I do appreciate
it, the .NET architecture has me completely confused. I have been
programming since I wrote Machine Language for 8088 and Z80 CPU's, and have
been published in Pascal.... but there are so many layers to .NET, I have no
idea how everything interfaces....

Though your sample code is not completely alien to me... I have no idea ....

(a) how to call it from a web page! How do I attach it to a form, or tell a
form to inherit the function (whichever is the correct terminology)??? ? I
could guess and play around, but right now, I'm just trying to get one
feature working, and will have no idea which part is not correct (the AD
code, or the connection to it???). I dont even know if I my files are
interconnected correctly at this point. Can I add it to an existing vb
file? Can I tell it to just compile the one form and associated code, so I
can ignore any other errors introduced by modifying global.asax or
web.config, or do I have to create a whole new project just to test this
little snippet. And then how do I connect the code to a form if I dont have
a namespace for it???

(b) what do I pass to it? I see the ByVal UserName parameter, and
understand ByVal parameter references... but where am I getting a UserName
to pass to it, or do I even need it?

BTW, since switching over to trying to make this work just in VS.NET, I have
included the reference to System.Director yServices. It no longer complains
about being able to import the namespace, but it still seems to have no idea
about what a DirectoryEntry is!

It's all so very confusing. I'm sorry, but I need a lot more direction on
how to test this code, and though I dont expect you to spend time doing so,
I am hoping someone out there knows a great reference or link that can help
solve my confusion regarding VS.NET project management and specific file
integration.

I do appreciate your help, but wish I knew what I am missing that makes .NET
seem so bewildering to me. I am not a newbie, I have been coding for a
fifth of a century and it is very frustrating that I am having so much of a
problem understanding how all these files work together in the .NET
architecture. And for that matter why I can not connect to the Directory
Services using VB!

I think I liked ADSI and ASP much better.... this is ridiculous! I never
had a problem interfacing with ADSI even using VBA, and have programmed some
very complicated routines using that model!

If anyone can point me to some decent comprehensive and TUTORIAL
documentation on how to use System.Director yServices in VB, it would be
greatly appreciated. Any books anyone would recommend??? Thanks!!!

Keith C. Jakobs, MCP

"Greg Burns" <greg_burns@DON T_SPAM_ME_hotma il.com> wrote in message
news:u6******** ******@TK2MSFTN GP10.phx.gbl...
I do not have System.Director yServices.dll copied to my bin folder (copy
local=false), but I do have it referenced in VS.

Here is the AD code I am using in a web app, with no problems. Might want to try this little function out and see if you can get it to work. Make sure
your virtual directory has anonymous access turned off.

Greg

Imports System.Director yServices
Public Class MyFunctions
Public Shared Function GetFullName(ByV al UserName As String) As String
Const DomainName As String = "mydomain.c om"

Dim oDirectory As New DirectoryEntry( "LDAP://" & DomainName)
Dim mySearcher As New DirectorySearch er(oDirectory)
Dim oResult As SearchResult
Dim sResult As String
mySearcher.Sear chScope = SearchScope.Sub tree
mySearcher.Refe rralChasing = ReferralChasing Option.All
mySearcher.Filt er = "(&(objectClass =user)(sAMAccou ntName=" &
UserName & "))"

Try
oResult = mySearcher.Find One
If Not oResult Is Nothing Then
sResult =
oResult.GetDire ctoryEntry.Prop erties("Display Name").Value.To String()
End If
Catch ex As Exception
Throw ex
End Try

oResult = Nothing
mySearcher.Disp ose()
oDirectory.Disp ose()

Return sResult
End Function
End Class

"Keith Jakobs, MCP" <el****@NOSPAM. hotmail.com> wrote in message
news:uC******** *******@TK2MSFT NGP12.phx.gbl.. .
Hi All....

I'm having a HECK of a time connecting to Active Directory using VB in
Visual Studio.NET 2003. Can anyone PLEASE help me?

All I am trying to do is list the current members of our Active Directory
on
a web page. If I can connect to the AD interfaces, then I think I can
handle it from there.

I do have a VS.NET C# project successfully working and enumerating
names, but can NOT for the life of me get VB to work with AD.

I originally tried to do it outside of VS.NET, but ran into problems

trying
to reference the System.Director yServices namespace unless I compiled the project inside VS.NET. I did make an earlier post to this group about

this
issue, and though the recommendations I received were insightful, they did not work (neither precompiling, nor including a direct reference to the

.dll
in the Page directive worked). I was finally able to import the name

space
by copying the dll to the application's /bin directory. But why would I
want to make a copy of it when it already exists on the system? So what
happened to being able to build .NET applications with just a text

editor???

So I decided to try a walkthrough of MS Knowledge Base article # 326340

(http://support.microsoft.com/default...0&Product=aspn
et). I followed it to the letter, and when I try to build the project in VS.NET, I get compilation errors in the .vb file I cut and pasted directly from the article!!!! The three errors are all in the

LdapAuthenticat ion.vb
file:

E:\inetpub\Auth Test\LdapAuthen tication.vb(19) : Array bounds cannot appear in
type specifiers.
E:\inetpub\Auth Test\LdapAuthen tication.vb(23) : Name 'entry' is not declared.
E:\inetpub\Auth Test\LdapAuthen tication.vb(24) : Name 'entry' is not

declared.

So.... if anyone can PLEASE HELP me get going here (I'm almost hoping

one of
you can confirm my install is pooched, otherwise I have no idea why it

does
not like the instructions as entered according to MS)

Again, all I need to do is connect to AD from a Web Page and list all

the users (Intranet site only).

Thanks in advance!

Keith C. Jakobs, MCP


Nov 21 '05 #4
You sound like me back when beta 2 was released. :^)

If you code doesn't know what DirectoryEntry is, even after referencing
System.Director yServices then you probably have not added the imports
statement at the top of your class file:

Imports System.Director yServices

This is just a shortcut, so you don't have to type
System.Director yServices.Direc toryEntry

As far as using my code. I would suggest making a new project to play. (I
took a look at that link to MS example, and they were doing some heady
things with your default web.config and stuff that will just confuse the
issue at hand).

Just add a new class file to your project. Right-click your project root,
choose Add New Item, select Class file. Name it MyFunctions.vb. Now just
past in my code.

Then from within your Page_Load method of, say your default.aspx page, do
this:

response.write( MyFunctions.Get FullName("mydom ain\burnsg"))

where the username is a valid username on your domain.

Just to be clear, this function doesn't do what you are trying to do. It
just takes a username and looks up the displayname from AD. It is just a
test to see that your can talk to AD.
(a) how to call it from a web page! How do I attach it to a form, or tell a form to inherit the function (whichever is the correct terminology)??? ? I
I would use the term "calling a method on a shared class". Another approach
(more complicated by far) would to have the MyFuctions class inherit from
Page. And have all of your .aspx pages inherit from MyFuctions rather than
the Page class. That way you could just call GetFullName directly from
Page_Load without the qualifier. But that is overkill for this exmample.

Let me know if I can help some more.

Greg

"Keith Jakobs, MCP" <el****@NOSPAM. hotmail.com> wrote in message
news:u%******** ********@TK2MSF TNGP11.phx.gbl. .. Hi Greg,

Thanks so much for your response and sample code. Though I do appreciate
it, the .NET architecture has me completely confused. I have been
programming since I wrote Machine Language for 8088 and Z80 CPU's, and have been published in Pascal.... but there are so many layers to .NET, I have no idea how everything interfaces....

Though your sample code is not completely alien to me... I have no idea .....
(a) how to call it from a web page! How do I attach it to a form, or tell a form to inherit the function (whichever is the correct terminology)??? ? I
could guess and play around, but right now, I'm just trying to get one
feature working, and will have no idea which part is not correct (the AD
code, or the connection to it???). I dont even know if I my files are
interconnected correctly at this point. Can I add it to an existing vb
file? Can I tell it to just compile the one form and associated code, so I can ignore any other errors introduced by modifying global.asax or
web.config, or do I have to create a whole new project just to test this
little snippet. And then how do I connect the code to a form if I dont have a namespace for it???

(b) what do I pass to it? I see the ByVal UserName parameter, and
understand ByVal parameter references... but where am I getting a UserName
to pass to it, or do I even need it?

BTW, since switching over to trying to make this work just in VS.NET, I have included the reference to System.Director yServices. It no longer complains about being able to import the namespace, but it still seems to have no idea about what a DirectoryEntry is!

It's all so very confusing. I'm sorry, but I need a lot more direction on
how to test this code, and though I dont expect you to spend time doing so, I am hoping someone out there knows a great reference or link that can help solve my confusion regarding VS.NET project management and specific file
integration.

I do appreciate your help, but wish I knew what I am missing that makes ..NET seem so bewildering to me. I am not a newbie, I have been coding for a
fifth of a century and it is very frustrating that I am having so much of a problem understanding how all these files work together in the .NET
architecture. And for that matter why I can not connect to the Directory
Services using VB!

I think I liked ADSI and ASP much better.... this is ridiculous! I never
had a problem interfacing with ADSI even using VBA, and have programmed some very complicated routines using that model!

If anyone can point me to some decent comprehensive and TUTORIAL
documentation on how to use System.Director yServices in VB, it would be
greatly appreciated. Any books anyone would recommend??? Thanks!!!

Keith C. Jakobs, MCP

"Greg Burns" <greg_burns@DON T_SPAM_ME_hotma il.com> wrote in message
news:u6******** ******@TK2MSFTN GP10.phx.gbl...
I do not have System.Director yServices.dll copied to my bin folder (copy
local=false), but I do have it referenced in VS.

Here is the AD code I am using in a web app, with no problems. Might want
to
try this little function out and see if you can get it to work. Make sure your virtual directory has anonymous access turned off.

Greg

Imports System.Director yServices
Public Class MyFunctions
Public Shared Function GetFullName(ByV al UserName As String) As String Const DomainName As String = "mydomain.c om"

Dim oDirectory As New DirectoryEntry( "LDAP://" & DomainName)
Dim mySearcher As New DirectorySearch er(oDirectory)
Dim oResult As SearchResult
Dim sResult As String
mySearcher.Sear chScope = SearchScope.Sub tree
mySearcher.Refe rralChasing = ReferralChasing Option.All
mySearcher.Filt er = "(&(objectClass =user)(sAMAccou ntName=" &
UserName & "))"

Try
oResult = mySearcher.Find One
If Not oResult Is Nothing Then
sResult =
oResult.GetDire ctoryEntry.Prop erties("Display Name").Value.To String()
End If
Catch ex As Exception
Throw ex
End Try

oResult = Nothing
mySearcher.Disp ose()
oDirectory.Disp ose()

Return sResult
End Function
End Class

"Keith Jakobs, MCP" <el****@NOSPAM. hotmail.com> wrote in message
news:uC******** *******@TK2MSFT NGP12.phx.gbl.. .
Hi All....

I'm having a HECK of a time connecting to Active Directory using VB in
Visual Studio.NET 2003. Can anyone PLEASE help me?

All I am trying to do is list the current members of our Active Directory
on
a web page. If I can connect to the AD interfaces, then I think I can
handle it from there.

I do have a VS.NET C# project successfully working and enumerating

names, but can NOT for the life of me get VB to work with AD.

I originally tried to do it outside of VS.NET, but ran into problems

trying
to reference the System.Director yServices namespace unless I compiled the project inside VS.NET. I did make an earlier post to this group about

this
issue, and though the recommendations I received were insightful, they did not work (neither precompiling, nor including a direct reference to the .dll
in the Page directive worked). I was finally able to import the name

space
by copying the dll to the application's /bin directory. But why would
I want to make a copy of it when it already exists on the system? So what happened to being able to build .NET applications with just a text

editor???

So I decided to try a walkthrough of MS Knowledge Base article # 326340

(http://support.microsoft.com/default...0&Product=aspn
et). I followed it to the letter, and when I try to build the project in VS.NET, I get compilation errors in the .vb file I cut and pasted directly from the article!!!! The three errors are all in the

LdapAuthenticat ion.vb
file:

E:\inetpub\Auth Test\LdapAuthen tication.vb(19) : Array bounds cannot appear
in
type specifiers.
E:\inetpub\Auth Test\LdapAuthen tication.vb(23) : Name 'entry' is not

declared.
E:\inetpub\Auth Test\LdapAuthen tication.vb(24) : Name 'entry' is not

declared.

So.... if anyone can PLEASE HELP me get going here (I'm almost hoping

one
of
you can confirm my install is pooched, otherwise I have no idea why it

does
not like the instructions as entered according to MS)

Again, all I need to do is connect to AD from a Web Page and list all

the users (Intranet site only).

Thanks in advance!

Keith C. Jakobs, MCP



Nov 21 '05 #5
Hi Greg!

Thanks so much for taking the additional time to clarify some of those
issues and provide more detailed instructions.

I will give those a try and see how successful I am. FYI though, I do have
the 'Imports System.Director yServices' in my class file, but it wasnt until
I compiled it within VS.NET that the IIS server knew what to do with it!

Keith

Keith C. Jakobs, MCP

"Greg Burns" <greg_burns@DON T_SPAM_ME_hotma il.com> wrote in message
news:uc******** ******@TK2MSFTN GP09.phx.gbl...
You sound like me back when beta 2 was released. :^)

If you code doesn't know what DirectoryEntry is, even after referencing
System.Director yServices then you probably have not added the imports
statement at the top of your class file:

Imports System.Director yServices

This is just a shortcut, so you don't have to type
System.Director yServices.Direc toryEntry

As far as using my code. I would suggest making a new project to play. (I took a look at that link to MS example, and they were doing some heady
things with your default web.config and stuff that will just confuse the
issue at hand).

Just add a new class file to your project. Right-click your project root,
choose Add New Item, select Class file. Name it MyFunctions.vb. Now just
past in my code.

Then from within your Page_Load method of, say your default.aspx page, do
this:

response.write( MyFunctions.Get FullName("mydom ain\burnsg"))

where the username is a valid username on your domain.

Just to be clear, this function doesn't do what you are trying to do. It
just takes a username and looks up the displayname from AD. It is just a
test to see that your can talk to AD.
(a) how to call it from a web page! How do I attach it to a form, or tell
a
form to inherit the function (whichever is the correct terminology)??? ? I

I would use the term "calling a method on a shared class". Another approach (more complicated by far) would to have the MyFuctions class inherit from
Page. And have all of your .aspx pages inherit from MyFuctions rather than
the Page class. That way you could just call GetFullName directly from
Page_Load without the qualifier. But that is overkill for this exmample.

Let me know if I can help some more.

Greg

"Keith Jakobs, MCP" <el****@NOSPAM. hotmail.com> wrote in message
news:u%******** ********@TK2MSF TNGP11.phx.gbl. ..
Hi Greg,

Thanks so much for your response and sample code. Though I do
appreciate it, the .NET architecture has me completely confused. I have been
programming since I wrote Machine Language for 8088 and Z80 CPU's, and

have
been published in Pascal.... but there are so many layers to .NET, I have no
idea how everything interfaces....

Though your sample code is not completely alien to me... I have no idea ....

(a) how to call it from a web page! How do I attach it to a form, or

tell a
form to inherit the function (whichever is the correct terminology)??? ?
I could guess and play around, but right now, I'm just trying to get one
feature working, and will have no idea which part is not correct (the AD
code, or the connection to it???). I dont even know if I my files are
interconnected correctly at this point. Can I add it to an existing vb
file? Can I tell it to just compile the one form and associated code, so I
can ignore any other errors introduced by modifying global.asax or
web.config, or do I have to create a whole new project just to test this
little snippet. And then how do I connect the code to a form if I dont have
a namespace for it???

(b) what do I pass to it? I see the ByVal UserName parameter, and
understand ByVal parameter references... but where am I getting a

UserName to pass to it, or do I even need it?

BTW, since switching over to trying to make this work just in VS.NET, I

have
included the reference to System.Director yServices. It no longer

complains
about being able to import the namespace, but it still seems to have no

idea
about what a DirectoryEntry is!

It's all so very confusing. I'm sorry, but I need a lot more direction on how to test this code, and though I dont expect you to spend time doing

so,
I am hoping someone out there knows a great reference or link that can

help
solve my confusion regarding VS.NET project management and specific file
integration.

I do appreciate your help, but wish I knew what I am missing that makes

.NET
seem so bewildering to me. I am not a newbie, I have been coding for a
fifth of a century and it is very frustrating that I am having so much of a
problem understanding how all these files work together in the .NET
architecture. And for that matter why I can not connect to the
Directory Services using VB!

I think I liked ADSI and ASP much better.... this is ridiculous! I never had a problem interfacing with ADSI even using VBA, and have programmed

some
very complicated routines using that model!

If anyone can point me to some decent comprehensive and TUTORIAL
documentation on how to use System.Director yServices in VB, it would be
greatly appreciated. Any books anyone would recommend??? Thanks!!!

Keith C. Jakobs, MCP

"Greg Burns" <greg_burns@DON T_SPAM_ME_hotma il.com> wrote in message
news:u6******** ******@TK2MSFTN GP10.phx.gbl...
I do not have System.Director yServices.dll copied to my bin folder (copy local=false), but I do have it referenced in VS.

Here is the AD code I am using in a web app, with no problems. Might want
to
try this little function out and see if you can get it to work. Make

sure your virtual directory has anonymous access turned off.

Greg

Imports System.Director yServices
Public Class MyFunctions
Public Shared Function GetFullName(ByV al UserName As String) As String Const DomainName As String = "mydomain.c om"

Dim oDirectory As New DirectoryEntry( "LDAP://" & DomainName)
Dim mySearcher As New DirectorySearch er(oDirectory)
Dim oResult As SearchResult
Dim sResult As String
mySearcher.Sear chScope = SearchScope.Sub tree
mySearcher.Refe rralChasing = ReferralChasing Option.All
mySearcher.Filt er = "(&(objectClass =user)(sAMAccou ntName=" &
UserName & "))"

Try
oResult = mySearcher.Find One
If Not oResult Is Nothing Then
sResult =
oResult.GetDire ctoryEntry.Prop erties("Display Name").Value.To String()
End If
Catch ex As Exception
Throw ex
End Try

oResult = Nothing
mySearcher.Disp ose()
oDirectory.Disp ose()

Return sResult
End Function
End Class

"Keith Jakobs, MCP" <el****@NOSPAM. hotmail.com> wrote in message
news:uC******** *******@TK2MSFT NGP12.phx.gbl.. .
> Hi All....
>
> I'm having a HECK of a time connecting to Active Directory using VB in > Visual Studio.NET 2003. Can anyone PLEASE help me?
>
> All I am trying to do is list the current members of our Active

Directory
on
> a web page. If I can connect to the AD interfaces, then I think I can > handle it from there.
>
> I do have a VS.NET C# project successfully working and enumerating

names,
> but can NOT for the life of me get VB to work with AD.
>
> I originally tried to do it outside of VS.NET, but ran into problems
trying
> to reference the System.Director yServices namespace unless I compiled the
> project inside VS.NET. I did make an earlier post to this group
about this
> issue, and though the recommendations I received were insightful, they
did
> not work (neither precompiling, nor including a direct reference to the .dll
> in the Page directive worked). I was finally able to import the
name space
> by copying the dll to the application's /bin directory. But why would I > want to make a copy of it when it already exists on the system? So what > happened to being able to build .NET applications with just a text
editor???
>
> So I decided to try a walkthrough of MS Knowledge Base article # 326340 >

(http://support.microsoft.com/default...0&Product=aspn > et). I followed it to the letter, and when I try to build the project in
> VS.NET, I get compilation errors in the .vb file I cut and pasted

directly
> from the article!!!! The three errors are all in the
LdapAuthenticat ion.vb
> file:
>
> E:\inetpub\Auth Test\LdapAuthen tication.vb(19) : Array bounds cannot

appear
in
> type specifiers.
> E:\inetpub\Auth Test\LdapAuthen tication.vb(23) : Name 'entry' is not
declared.
> E:\inetpub\Auth Test\LdapAuthen tication.vb(24) : Name 'entry' is not
declared.
>
> So.... if anyone can PLEASE HELP me get going here (I'm almost
hoping one
of
> you can confirm my install is pooched, otherwise I have no idea why
it does
> not like the instructions as entered according to MS)
>
> Again, all I need to do is connect to AD from a Web Page and list

all the
> users (Intranet site only).
>
> Thanks in advance!
>
> Keith C. Jakobs, MCP
>
>



Nov 21 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
9607
by: hykim | last post by:
Hello, everyone. according to MSDN, there is any constructor of System.DirectoryServices.SearchResultCollection Class. if I implement DirectorySearcher.FindAll() method by myself, then how can I instanciate SearchResultCollection Class. more clearly, a SearchResult object is created, at the inside of FindAll() method, then how can I put this object into the SearchResultCollection object. there is any method releated to input operation.
1
7373
by: Jason Gleason | last post by:
I am using the following method in a web service that utilizes the system.directoryservices namespace: public ArrayList GetAllAppPools(){ System.DirectoryServices.DirectoryEntry apppools = new DirectoryEntry("IIS://webserver/W3SVC/AppPools"); ArrayList appPoolNames = new ArrayList(); foreach(DirectoryEntry de in apppools.Children) { appPoolNames.Add(de.Name);
1
16199
by: Gaab | last post by:
Hi Folks, After the weekend I wanted to start working on my c#/asp.net project, but when I tried to open it on my machine i got the following error: Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
1
1718
by: Enosh Chang | last post by:
Hi all, I encounter some problem in DirectoryServices, could someone help me? private void InitLoginUser() { DirectoryEntry objEntry = new DirectoryEntry(); DirectorySearcher objSearcher = new DirectorySearcher(); SearchResult objResult;
9
2137
by: Günther Rühmann | last post by:
Hi, I´m not sure if i´m right int this group... My problem: I made a vb .net application that reads from AD via System.Directoryservices.Directoryentry. The appliocation enumerates group members. It works fine on W2k - machines. It works on a WinNT 4 - server, too, but it stops with a runtime error on any Windows 4.0 Workstation. The error is: System.Runtime.InteropServices.COMException 0x800500F. at...
7
2925
by: turbon | last post by:
Hello, I am writing code, which will copy webServices from one IIS 6.0 webserver to another and using DirentoryServices to achieve this purpose. And I have problems with authentication - I get an error whenever I try to read properties of DirectoryEntry object. I had same problems when I was using WMI, but there setting ConnectionOptions co = new ConnectionOptions(); co.Authentication = AuthenticationLevel.PacketPrivacy; solved the...
6
4080
by: Mark Rae | last post by:
Hi, I'm in the process of updating an ASP.NET v1.1 web app to v2. The app uses ActiveDirectory a great deal, and I'm trying to use the new System.Collections.Generic namespace where possible, having been advised by several luminaries that that is a "good thing to do"... :-) However, I'm experiencing a problem with the IEnumerable interface. (N.B. I understand fully that I should be using the LDAP provider instead of the WinNT provider...
6
5460
by: bugnthecode | last post by:
Hi, I'm building a small desktop app in VS Std 2005 with C# and .net 2.0. I've managed to get the code together to query the ldap my company has, but every time I attempt to access a specific property a COM Exception gets thrown, and I can't figure out why. This is a desktop app. example("ldap.example.com", "ou=People,dc=example,dc=com"); public void example(string server, string ou) { searcher = new DirectorySearcher(new...
7
2816
by: aamirghanchi | last post by:
Hi, I had .Net 1.1 app that worked fine. I recently migrated it to 2.0 but am getting compilation errors, among which DirectoryServices classes are not being recognized by the VS 2005 at build time. I can clearly see the reference to System.DirectoryServices 2.0.0 GAC in the reference list and there is no error where the Imports System.DirectoryServices statement is. Its listing errors all over for the classes under its namespace:
0
8411
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8323
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8838
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8513
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8613
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7351
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6176
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1969
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.