I am designing an application that need to get list of all the client
computers on Windows network domain (in same domain on which application will
run).

how can i do this in .NET

Thanx in advance

RE: .Net: Getting list of network clients by LuuSinhNgoc

LuuSinhNgoc
Tue Jun 28 05:48:02 CDT 2005

Private Sub GetMachineNames()
cbReceiver.Items.Clear()
Dim myProcess As Process = New Process
Dim s As String
myProcess.StartInfo.FileName = "cmd.exe"
myProcess.StartInfo.UseShellExecute = False
myProcess.StartInfo.CreateNoWindow = True
myProcess.StartInfo.RedirectStandardInput = True
myProcess.StartInfo.RedirectStandardOutput = True
myProcess.StartInfo.RedirectStandardError = True
myProcess.Start()
Dim sIn As StreamWriter = myProcess.StandardInput
sIn.AutoFlush = True

Dim sOut As StreamReader = myProcess.StandardOutput
Dim sErr As StreamReader = myProcess.StandardError


sIn.Write("net view" & System.Environment.NewLine)
sIn.Write("exit" & System.Environment.NewLine)
s = sOut.ReadToEnd

If Not myProcess.HasExited Then
myProcess.Kill()
End If
sIn.Close()
sOut.Close()
sErr.Close()
myProcess.Close()
Dim strarray() As String = s.Split(ControlChars.CrLf)
Dim strarry1 As String
Dim finalstr As String
For Each strarry1 In strarray
If strarry1.IndexOf("\\") <> -1 Then
finalstr = strarry1.Remove(1, 2)
cbReceiver.Items.Add(finalstr.Trim())
End If

Next
End Sub

Re: Getting list of network clients by Willy

Willy
Tue Jun 28 06:25:43 CDT 2005

Take a look at the System.Management classes and WMI.

Willy.

"ramata" <ramata@discussions.microsoft.com> wrote in message
news:BCDA754E-7512-4143-986B-67EA619B0B99@microsoft.com...
>I am designing an application that need to get list of all the client
> computers on Windows network domain (in same domain on which application
> will
> run).
>
> how can i do this in .NET
>
> Thanx in advance



Re: Getting list of network clients by ramata

ramata
Wed Jun 29 03:53:04 CDT 2005

I looked into the WMI classes but could not find any class that list clients
on the network.

Ramta

"Willy Denoyette [MVP]" wrote:

> Take a look at the System.Management classes and WMI.
>
> Willy.
>
> "ramata" <ramata@discussions.microsoft.com> wrote in message
> news:BCDA754E-7512-4143-986B-67EA619B0B99@microsoft.com...
> >I am designing an application that need to get list of all the client
> > computers on Windows network domain (in same domain on which application
> > will
> > run).
> >
> > how can i do this in .NET
> >
> > Thanx in advance
>
>
>