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
Ajo Mathew
NA
2
0
adding a project and accesing the form.. or network bandwidth monitr
Mar 24 2010 10:50 PM
I am doing a windows form where i need to get the network usage the upload,download details... seperatly from all the network adapters...
I already got the code but it was difficult to understand... FreeMeter from sourceforgenet...
where i need only the upload and download detail showing function which is very depend on the other froms in the project...
this is the basic code
i have from another project...
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Diagnostics;
namespace loopback
{
class Program
{
static void Main(string[] args)
{
ShowNetworkTraffic();
}
private static void ShowNetworkTraffic()
{
PerformanceCounterCategory performanceCounterCategory = new PerformanceCounterCategory("Network Interface");
string instance = performanceCounterCategory.GetInstanceNames()[2]; // 1st NIC !
PerformanceCounter performanceCounterSent = new PerformanceCounter("Network Interface", "Bytes Sent/sec", instance);
PerformanceCounter performanceCounterReceived = new PerformanceCounter("Network Interface", "Bytes Received/sec", instance);
float up =0, dwn = 0;
for (int i = 0; i < 150; i++)
{
up = up + performanceCounterSent.NextValue();
dwn = dwn + performanceCounterReceived.NextValue();
Console.WriteLine("bytes sent: {0}k\tbytes received: {1}k", performanceCounterSent.NextValue(), performanceCounterReceived.NextValue());
Thread.Sleep(100);
}
Console.WriteLine("{0}", up);
Console.ReadKey();
}
}
}
Reply
Answers (
0
)
DataSet Xml Schema validation does not work
event scheduler and task remainder