473,466 Members | 1,408 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Getobject C# Equevlent

I'm trying to add users to active directing using asp.net forms. All the
example on the web are for VB and using the VB method GetObject. Is there a
C# sharp equivalent of GetObject or can someone point me to an example of
how to do this in C#.
Thanks
--Mike
Nov 18 '05 #1
3 3558
Wait, you found examples of how to do this using VB.NET or VBScript? If I
remember correctly, those examples were using old ASP/VBScript and not
VB.NET and are severely outdated.

Anyhow, there is no equivalent for GetObject() (and it's a good thing too...
VB let's you get away with late-binding objects. C# doesn't) in C#.

What you need to do is look into using the System.Enterprise namespace.

I did a quick search and found a few links for you to look at. I hope they
will be of assistance to you.

http://www.dotnet247.com/247referenc.../18/92050.aspx

http://support.microsoft.com/default...b;EN-US;306273 (adds a user
to the local system, but should be able to be adapted to AD)

http://www.codeproject.com/dotnet/addnewuser.asp

--
HTH

Kyril Magnos

Question of the day:
What is Mono?
A) Disease where the lymph nodes become swollen.
B) A single sound
C) A synonym for one
D) A port of .NET meant to royally irritate MSFT
E) All of the above.

"]-[aTc]-[" <ha**********@hotmail.com> wrote in message
news:%2******************@TK2MSFTNGP11.phx.gbl...
| I'm trying to add users to active directing using asp.net forms. All the
| example on the web are for VB and using the VB method GetObject. Is there
a
| C# sharp equivalent of GetObject or can someone point me to an example of
| how to do this in C#.
| Thanks
| --Mike
|
|
Nov 18 '05 #2
There are a number of C# samples dealing with Active Directory here:
http://msdn.microsoft.com/library/de...e_examples.asp

HTH,

--
Scott
http://www.OdeToCode.com

On Fri, 16 Jul 2004 15:00:23 -0500, "]-[aTc]-["
<ha**********@hotmail.com> wrote:
I'm trying to add users to active directing using asp.net forms. All the
example on the web are for VB and using the VB method GetObject. Is there a
C# sharp equivalent of GetObject or can someone point me to an example of
how to do this in C#.
Thanks
--Mike


Nov 18 '05 #3
On Fri, 16 Jul 2004 13:18:59 -0700, Kyril Magnos <ky**********@yahoo.com>
wrote:
VB let's you get away with late-binding objects. C# doesn't) in C#.


Actually late-binding is possible in alot of places (C# and VB.NET). You
can load any (valid) class given its name as a string, for example.

--
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET
Nov 18 '05 #4

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

Similar topics

10
by: Rich | last post by:
Hello, I have not been working with ASP for too long at this time and am not real familiar with a lot of things about ASP. I have searched for articles on the following question but not come up...
2
by: CJM | last post by:
I'm building an ASP app that uses Windows Authentication (IWA). I have an authentication routine that assesses if & how the user can use the application (see code snippet below). Users of a...
5
by: Andrei | last post by:
Hello, I posted yesterday the same problem, but now I want to be more specific about it. My intention is to create a windows service to process some Word documents. If I use CreateObject to...
3
by: Otie | last post by:
I found the following under the GetObject help notes and in the example for GetObject: "This example uses the GetObject function to get a reference to a specific Microsoft Excel worksheet...
1
by: Martyn Gwynne | last post by:
I am progressing with GetObject .. The following code will open and print a report. I enquired how to open, maximise WITHOUT printing by default and it was suggested that I look at further...
2
by: Randy Harris | last post by:
I'm going nuts trying to figure this out, sure hope someone can help. My application uses TransferSpreadsheet to insert data into an existing Excel spreadsheet (which works), then opens and...
17
by: ad | last post by:
We can use GetObject to load the instance of COM form file like: Dim CADObject As Object CADObject = GetObject("C:\CAD\SCHEMA.CAD") How can we implement the two statements above in CSharp?
3
by: perspolis | last post by:
Is there a method like GetObject in vb to get an instance of current object runnig??
1
by: joe | last post by:
We just moved a legacy asp application to a Win2003 server. The following line of code: set objUser = GetObject("WinNT://" & strDomain & "/" & strUserName & ",user") Raises the following...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
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...
0
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.