Getting bytes downloaded/uploaded for dialup connections (modem)

timiman

Newcomer
Joined
Apr 1, 2004
Messages
1
Hello,

I'm converting a application from VB6 to VB.Net 2003 and found some problems with that:

a. Firstly, I cant find out a way to retrieve the bytes downloaded/uploaded from the current dialup connection. In VB6 I had use the RAS Statistics for the same reason. Now in .Net, I cant find something familiar to do so. Just to put you in the spirit, my application is something like DuMeter. It shows the per second speed,in kb and kb/sec, of the dialup connection (downloaded/uploaded).

b. Secondly, I cant find out a way to disconnect the modem, the dialup connection to be excactly. The connection is made through the Windows dialup control and not inside from my applycation. My application, just checks some parameters the user want to use for closing the connection (no bytes received, after some time etc.

Any help will... help me a lot
Thanks in advanced.

PS1. Check my home page for my appl's screenshot in http://users.forthnet.gr/ath/epet/epakcalc.html
This screenshot is from the VB6 version. I hope I can make the same in VB.Net 2003
PS2. You can try 'Internet Calculator' but its in Greek language only. Sorry 8-(
 
I'm using this call (written in C#) for checking the dial-up connection:
Code:
	public const int INTERNET_CONNECTION_CONFIGURED = 0x40;
	public const int INTERNET_CONNECTION_LAN = 0x02;
	public const int INTERNET_CONNECTION_MODEM = 0x01;
	public const int INTERNET_CONNECTION_MODEM_BUSY = 0x08;
	public const int INTERNET_CONNECTION_OFFLINE = 0x20;
	public const int INTERNET_CONNECTION_PROXY = 0x04;
	public const int INTERNET_RAS_INSTALLED = 0x10;
	[DllImport("wininet.dll")]
	static extern System.Int32 InternetGetConnectedStateEx(out System.Int32 lpdwFlags, StringBuilder lpszConnectionName, System.Int32 dwNameLen, System.Int32 dwReserved);
It's very intuitive.
I'm still looking for some code to monitor the traffic ;)
 
Back
Top