Click here to Skip to main content
15,892,269 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralModifying Design time behavior Pin
Teflon2-Mar-05 0:50
Teflon2-Mar-05 0:50 
GeneralRe: Modifying Design time behavior Pin
Mathew Hall3-Mar-05 21:01
Mathew Hall3-Mar-05 21:01 
GeneralRe: Modifying Design time behavior Pin
Teflon_004534-Mar-05 6:57
sussTeflon_004534-Mar-05 6:57 
GeneralBmp to Png Conversion Pin
tosun1-Mar-05 14:35
tosun1-Mar-05 14:35 
General.Net Macros Pin
jGuild1-Mar-05 10:54
jGuild1-Mar-05 10:54 
General.NET Framework Book Pin
PaulCurry1-Mar-05 8:37
PaulCurry1-Mar-05 8:37 
GeneralRe: .NET Framework Book Pin
carlop()2-Mar-05 5:53
carlop()2-Mar-05 5:53 
GeneralList Of Domains Pin
Iftach Smith1-Mar-05 2:53
Iftach Smith1-Mar-05 2:53 
Hi,
I am trying to list out the domains on the server using System.DirectoryServices. It gives domains, but list contains only one domain name. Our server has more that 3 domains and subdomains.

The code which i am using is as follows:
<br />
private StringCollection GetDomainList() <br />
{ <br />
  StringCollection domainList = new StringCollection(); <br />
  try <br />
  { <br />
    DirectoryEntry en = new DirectoryEntry("WinNT://"); <br />
    // Search for objectCategory type "Domain" <br />
    DirectorySearcher srch = new DirectorySearcher("objectCategory=Domain"); <br />
    SearchResultCollection coll = srch.FindAll(); <br />
    // Enumerate over each returned domain. <br />
    foreach (SearchResult rs in coll) <br />
    { <br />
      ResultPropertyCollection resultPropColl = rs.Properties; <br />
      foreach( object domainName in resultPropColl["name"]) <br />
      { <br />
        domainList.Add(domainName.ToString()); <br />
      } <br />
    } <br />
  } <br />
  catch (Exception ex) <br />
  { <br />
    Trace.Write(ex.Message); <br />
  } <br />
  return domainList; <br />
} <br />


Is it the correct way to list the domains? It is giving only the domain name in which i am a user and i log in with this user. This domain has subdomains and also along with this other domains are also there.

Can you please help out?

Thanx
Iftach
Questionis setting an object reference atomic? Pin
Member 168528-Feb-05 21:51
Member 168528-Feb-05 21:51 
AnswerRe: is setting an object reference atomic? Pin
S. Senthil Kumar1-Mar-05 9:13
S. Senthil Kumar1-Mar-05 9:13 
GeneralRe: is setting an object reference atomic? Pin
Member 16851-Mar-05 9:49
Member 16851-Mar-05 9:49 
GeneralRe: is setting an object reference atomic? Pin
S. Senthil Kumar1-Mar-05 16:01
S. Senthil Kumar1-Mar-05 16:01 
GeneralWindows Forms ListBox &quot;GetItemValue&quot; method Pin
dxlee28-Feb-05 8:48
dxlee28-Feb-05 8:48 
GeneralMDI Window Pin
Small Rat28-Feb-05 4:46
Small Rat28-Feb-05 4:46 
GeneralInstaller don`t remove assemblies Pin
Adnan Siddiqi28-Feb-05 0:22
Adnan Siddiqi28-Feb-05 0:22 
GeneralProblem rendering bitmaps with .NET CF Pin
Georg Fuchs27-Feb-05 23:07
Georg Fuchs27-Feb-05 23:07 
QuestionRun .Net on Win95? Pin
P-TAE27-Feb-05 19:02
P-TAE27-Feb-05 19:02 
AnswerRe: Run .Net on Win95? Pin
Colin Angus Mackay27-Feb-05 19:40
Colin Angus Mackay27-Feb-05 19:40 
GeneralWindows Hooks Pin
Member 176527127-Feb-05 13:39
Member 176527127-Feb-05 13:39 
GeneralRe: Windows Hooks Pin
ursus zeta28-Feb-05 15:07
ursus zeta28-Feb-05 15:07 
Questionwhy .net...? Pin
Hamed Musavi26-Feb-05 16:09
Hamed Musavi26-Feb-05 16:09 
AnswerRe: why .net...? Pin
Colin Angus Mackay26-Feb-05 16:43
Colin Angus Mackay26-Feb-05 16:43 
GeneralRe: why .net...? Pin
S. Senthil Kumar26-Feb-05 19:49
S. Senthil Kumar26-Feb-05 19:49 
GeneralRe: why .net...? Pin
Hamed Musavi27-Feb-05 16:54
Hamed Musavi27-Feb-05 16:54 
GeneralRe: why .net...? Pin
Colin Angus Mackay27-Feb-05 19:40
Colin Angus Mackay27-Feb-05 19:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.