[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

How to determine a modems connection speed

Posted on 2001-08-09
7
Medium Priority
?
382 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: 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

Independent Software Vendors: 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!

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

650 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