?
Solved

How to determine a modems connection speed

Posted on 2001-08-09
7
Medium Priority
?
378 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 5

Accepted Solution

by:
alanwhincup earned 800 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: 6367731
oops, forgot to include this page too
it's free but withoutsource code
http://members.nbci.com/onlinemeter/

0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

764 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