Download Project : GetNetworkIpAddress.zip
1. first you have to a namespace
using System.IO;
using System.Net;
using System.Net.NetworkInformation;
Process netUtility = new Process();
netUtility.StartInfo.FileName = "net.exe";
netUtility.StartInfo.CreateNoWindow = true;
netUtility.StartInfo.Arguments = "view";
netUtility.StartInfo.RedirectStandardOutput = true;
netUtility.StartInfo.UseShellExecute = false;
netUtility.StartInfo.RedirectStandardError = true;
netUtility.Start();
StreamReader streamReader =StreamReader(netUtility.StandardOutput.BaseStream, netUtility.StandardOutput.CurrentEncoding);
string line = "";
while ((line = streamReader.ReadLine()) != null)
{
if (line.StartsWith("\\"))
{
listBox1.Items.Add(line.Substring(2).Substring(0, line.Substring(2).IndexOf(" ")).ToUpper());
}
}
streamReader.Close();
netUtility.WaitForExit(1000);
See Also :
- Android Installation for beginners_Part-1
- Android Installation for beginners
- How to Resize a Partition in Windows 7 or Vista
- How to customize send to menu.
- How to change Folder background in windows 7
--
/\/ir@\/ <(.'.)>
0 comments:
Post a Comment
Thanks for comment