473,398 Members | 2,212 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

List user group in my pc

ad
I want to List user group in MyPc (the name of my computer)
I use the codes below, but it fail in run time at line 2,
How can I correct it?


DirectoryEntry group = new DirectoryEntry("WinNT://WORKGROUP/MyPC");
object members = group.Invoke("Members",null);
foreach( object member in (IEnumerable) members)
{

DirectoryEntry x = new DirectoryEntry(member);
ddlGroup.Items.Add(x.Name);
}
Nov 16 '05 #1
4 4692
You have to include the groupname in the path like :
new DirectoryEntry("WinNT://MyPC/GroupName,group");
or:
new DirectoryEntry("WinNT://Workgroup/MyPC/GroupName,group");

Willy.

"ad" <ad@wfes.tcc.edu.tw> wrote in message
news:uR**************@tk2msftngp13.phx.gbl...
I want to List user group in MyPc (the name of my computer)
I use the codes below, but it fail in run time at line 2,
How can I correct it?


DirectoryEntry group = new DirectoryEntry("WinNT://WORKGROUP/MyPC");
object members = group.Invoke("Members",null);
foreach( object member in (IEnumerable) members)
{

DirectoryEntry x = new DirectoryEntry(member);
ddlGroup.Items.Add(x.Name);
}

Nov 16 '05 #2
ad
Thank for your answer,

I want to list all the user group in my Server.

I have tried the code you give.
It resulted in a error in run time.

"Willy Denoyette [MVP]" <wi*************@pandora.be> ¼¶¼g©ó¶l¥ó·s»D
:OY**************@TK2MSFTNGP12.phx.gbl...
You have to include the groupname in the path like :
new DirectoryEntry("WinNT://MyPC/GroupName,group");
or:
new DirectoryEntry("WinNT://Workgroup/MyPC/GroupName,group");

Willy.

"ad" <ad@wfes.tcc.edu.tw> wrote in message
news:uR**************@tk2msftngp13.phx.gbl...
I want to List user group in MyPc (the name of my computer)
I use the codes below, but it fail in run time at line 2,
How can I correct it?


DirectoryEntry group = new DirectoryEntry("WinNT://WORKGROUP/MyPC");
object members = group.Invoke("Members",null);
foreach( object member in (IEnumerable) members)
{

DirectoryEntry x = new DirectoryEntry(member);
ddlGroup.Items.Add(x.Name);
}


Nov 16 '05 #3
What error? Please post the exception message and possibly your code.

Willy.

"ad" <ad@wfes.tcc.edu.tw> wrote in message
news:OQ**************@TK2MSFTNGP10.phx.gbl...
Thank for your answer,

I want to list all the user group in my Server.

I have tried the code you give.
It resulted in a error in run time.

"Willy Denoyette [MVP]" <wi*************@pandora.be> ¼¶¼g©ó¶l¥ó·s»D
:OY**************@TK2MSFTNGP12.phx.gbl...
You have to include the groupname in the path like :
new DirectoryEntry("WinNT://MyPC/GroupName,group");
or:
new DirectoryEntry("WinNT://Workgroup/MyPC/GroupName,group");

Willy.

"ad" <ad@wfes.tcc.edu.tw> wrote in message
news:uR**************@tk2msftngp13.phx.gbl...
> I want to List user group in MyPc (the name of my computer)
> I use the codes below, but it fail in run time at line 2,
> How can I correct it?
>
>
>
>
> DirectoryEntry group = new DirectoryEntry("WinNT://WORKGROUP/MyPC");
> object members = group.Invoke("Members",null);
> foreach( object member in (IEnumerable) members)
> {
>
> DirectoryEntry x = new DirectoryEntry(member);
> ddlGroup.Items.Add(x.Name);
> }
>
>



Nov 16 '05 #4
ad
Thank,
My OS is not English version, I will try to translate the error message.

"Willy Denoyette [MVP]" <wi*************@pandora.be> ¼¶¼g©ó¶l¥ó·s»D
:uW*************@TK2MSFTNGP12.phx.gbl...
What error? Please post the exception message and possibly your code.

Willy.

"ad" <ad@wfes.tcc.edu.tw> wrote in message
news:OQ**************@TK2MSFTNGP10.phx.gbl...
Thank for your answer,

I want to list all the user group in my Server.

I have tried the code you give.
It resulted in a error in run time.

"Willy Denoyette [MVP]" <wi*************@pandora.be> ¼¶¼g©ó¶l¥ó·s»D
:OY**************@TK2MSFTNGP12.phx.gbl...
You have to include the groupname in the path like :
new DirectoryEntry("WinNT://MyPC/GroupName,group");
or:
new DirectoryEntry("WinNT://Workgroup/MyPC/GroupName,group");

Willy.

"ad" <ad@wfes.tcc.edu.tw> wrote in message
news:uR**************@tk2msftngp13.phx.gbl...
> I want to List user group in MyPc (the name of my computer)
> I use the codes below, but it fail in run time at line 2,
> How can I correct it?
>
>
>
>
> DirectoryEntry group = new DirectoryEntry("WinNT://WORKGROUP/MyPC");
> object members = group.Invoke("Members",null);
> foreach( object member in (IEnumerable) members)
> {
>
> DirectoryEntry x = new DirectoryEntry(member);
> ddlGroup.Items.Add(x.Name);
> }
>
>



Nov 16 '05 #5

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

Similar topics

3
by: BobTheDatabaseBoy | last post by:
.... got: win2K, v8.1.6 login to win2K is to the network: user; bob13, domain; foo it's a win2K domain. i then login to my local db as db2admin. LIST APPLICATIONS fails with security error. ...
5
by: William Wisnieski | last post by:
Hello Everyone, I have a query by form with several list boxes. The user selects items from the list boxes and clicks a button that returns results in a datasheet subform. One of the list...
4
by: Peter Tragardh | last post by:
I want my program to create a list of every user in the domain that is part of a special group. Any ideas?
8
by: Galina | last post by:
Hello I have 6 dependent list boxes on my ASP page:  Faculty;  Lecturer;  Course;  Course occurrence;  Group;  Week commencing date. When faculty is selected, lists of lecturers and...
1
by: lecnac | last post by:
Sorry for the repost. I must have done something wrong when I tried to post my reply (I can't seem to find it). Anyway, I'd really appreciate any help that anyone could provide. My issue is...
10
by: Jeff Williams | last post by:
How can I get a list of the Groups both Local and Domain groups a User belongs to.
5
by: brino | last post by:
hi all ! i have a drop down list in a form. the users of the data base are typing text in there instead of selecting from the list. how can i make it so they cannot type text and only select...
5
by: admin | last post by:
I have a class that has a function that should query a database and return a list of usernames as well as their id. What type should I use as a return type, that can hold data such as: user1, 1...
6
by: Henrik Goldman | last post by:
Hello, I have a dataset which consist of a string username and string hostname as a key and then an integer representing a count as the matching "second" value in a pair. So far I've used...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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,...
0
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...

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.