know i have the calculation class and main client forms in my client side, and main server forms in my server side.
what should i do so that my server able to display those values (upload, speed, download, etc)?? what codes should i write? what kind of method can be used such as hashtable? dictionary? get set methods? or any other way??
i really had no idea. please help, thanks
here is the calculation snip codes in client:
Expand|Select|Wrap|Line Numbers
- class Bandwidth_Speed
- {
- private int bytesSentSpeed = 0;
- private int bytesReceivedSpeed = 0;
- private string Speed, InterfaceType, BytesReceived = "0", BytesSent = "0", Upload, Download, NetInterface;
- private NetworkInterface[] netface;
- public void InitializeNetworkInterface()
- {
- netface = NetworkInterface.GetAllNetworkInterfaces();
- for (int i = 0; i < netface.Length; i++)
- {
- BytesReceived = "0";
- BytesSent = "0";
- for (int x = 0; x < 2; x++)
- {
- NetworkInterface nic = netface[i];
- IPv4InterfaceStatistics interfaceStats = nic.GetIPv4Statistics();
- bytesSentSpeed = (int)(interfaceStats.BytesSent - int.Parse(BytesSent)) / 1024;
- bytesReceivedSpeed = (int)(interfaceStats.BytesReceived - int.Parse(BytesReceived)) / 1024;
- Speed = (nic.Speed / (1024 * 1024)) + " MB";
- InterfaceType = nic.NetworkInterfaceType.ToString();
- BytesReceived = interfaceStats.BytesReceived.ToString();
- BytesSent = interfaceStats.BytesSent.ToString();
- Upload = bytesSentSpeed.ToString() + " kB/s";
- Download = bytesReceivedSpeed.ToString() + " kB/s";
- NetInterface = netface[i].Name;
- Thread.Sleep(500);
- }
- }
- }
- }