TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
chris
NA
20
0
Netstat GUI
Feb 10 2009 3:03 PM
Basically I am making a netstat GUI. netstat is a command in the cmd that shows all the IP addresses you are connected with. I coded my app, but for some reason it will only show one IP not all the one's I am connected to.
Here is my code:
private void button1_Click(object sender, EventArgs e)
{
iplist.ReadOnly = true;
IPGlobalProperties ipProperties = IPGlobalProperties.GetIPGlobalProperties();
IPEndPoint[] endPoints = ipProperties.GetActiveTcpListeners();
TcpConnectionInformation[] tcpConnections = ipProperties.GetActiveTcpConnections();
//List IPS
foreach (TcpConnectionInformation info in tcpConnections)
{
iplist.Text = ("Local : " + info.LocalEndPoint.Address.ToString()
+ ":" + info.LocalEndPoint.Port.ToString()
+ "\nRemote : " + info.RemoteEndPoint.Address.ToString()
+ ":" + info.RemoteEndPoint.Port.ToString()
+ "\nState : " + info.State.ToString() + "\n\n");
}
}
Reply
Answers (
3
)
Bit & Bytes Confusion / Troubles
Learn VC++ or VC# ??