Solved

How to determine a modems connection speed

Posted on 2001-08-09
7
370 Views
Last Modified: 2010-04-06
How can you determine a modems connection speed (the b.p.s. rate) from within a Delphi application, while connected to a DUN connection?
0
Comment
Question by:DeveloperDan
7 Comments
 
LVL 5

Accepted Solution

by:
alanwhincup earned 200 total points
ID: 6367624
You could try something like this:

Remember to add 'Registry' to the uses clause of the unit.

procedure TForm1.Button1Click(Sender: TObject);
var
  Reg : TRegistry;
  ConnectBuffer : array[0..3] of Byte;
  ConnectSpeed : LongInt;
begin
  Reg := TRegistry.Create;
  with Reg do
  begin
    RootKey := HKEY_DYN_DATA;
    if OpenKey('\PerfStats\StatData', False) then
    begin
      ReadBinaryData('Dial-Up Adapter\ConnectSpeed', ConnectBuffer, 4);
      ConnectSpeed := LongInt(ConnectBuffer);
      Label1.Caption := 'Connection Speed: ' + IntToStr(ConnectSpeed);
    end;
  end;
  Reg.Free;
end;

Cheers,

Alan
0
 
LVL 22

Expert Comment

by:Mohammed Nasman
ID: 6367724
0
 
LVL 22

Expert Comment

by:Mohammed Nasman
ID: 6367731
oops, forgot to include this page too
it's free but withoutsource code
http://members.nbci.com/onlinemeter/

0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 5

Expert Comment

by:Gwena
ID: 6370248
listening :-)
0
 
LVL 5

Expert Comment

by:alanwhincup
ID: 6372787
For Win 9x, you can check the performance counters in the registry to check the modem speed (as I've done above), but this is not available under the NT platform. The correct way to monitor the modem would be to use TAPI, to get the 'answered' event that reports the connection speed, this works on both Win 9x and NT. This would take alot of time and effort to code so the best solution i could find for you which would work in both platforms would be to use this component:

http://www.magsys.co.uk/delphi/index.shtml (TMagRas)
0
 
LVL 26

Expert Comment

by:Russell Libby
ID: 8741603
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept alanwhincup's comment as answer

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Thank you,
Russell

EE Cleanup Volunteer
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now