Terry,
Using IPConfig as command gives you in a string your subnetmask if you want
that filtering it than using regex or simple using indexof should give you
the result you want..
Using than this you get the string
\\\
Public Class Test
Public Shared Sub Main()
Dim p As New Process
Dim pi As New ProcessStartInf o
pi.UseShellExec ute = False
pi.RedirectStan dardOutput = True
pi.WorkingDirec tory = "C:\windows\sys tem32"
'this for nt* computers
pi.FileName = "ipconfig"
p.StartInfo = pi
p.StartInfo = pi
p.Start()
Dim sr As IO.StreamReader = p.StandardOutpu t
Dim sb As New System.Text.Str ingBuilder("")
Dim input As Integer = sr.Read
Do Until input = -1
sb.Append(ChrW( input))
input = sr.Read
Loop
MessageBox.Show (sb.ToString)
End Sub
End Class
///
I hope this helps,
Cor
"Terry Olsen" <to******@hotma il.com> schreef in bericht
news:ee******** ******@TK2MSFTN GP02.phx.gbl...
I am using VB 2005. I can't seem to find a way to get my local Subnet Mask.
The only thing mentioned from googling is the GetIpAddrTable API, but so
far, i've had no luck getting a call to it working. Another idea was to
traverse the registry at
HKLM/System/CurrentControlS et/Services/Tcpip/Parameters/Interfaces. But
that seems really sloppy. One would think that VB 2005 would have a
My.Computer.Ne twork.Subnet property.