?
Solved

Getting the LAN Connection Speed 10 mbits  100 mbits, Half Duplex / Full duplex

Posted on 2004-10-19
4
Medium Priority
?
1,216 Views
Last Modified: 2010-05-18
Does any one know how to get the Local area network connection speed?

I need to know if it is 10, 100 or 1000
and if it is Half duplex or Full duplex

Using Delphi 7, Windows 2000 pro

Cheers Darren
0
Comment
Question by:dhnkley
[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
  • 2
4 Comments
 
LVL 17

Expert Comment

by:Wim ten Brink
ID: 12355969
Interesting... I expected this information to be available through WMI but it isn't. Besides, you might be in trouble since there are some different network speeds available too. I once had an USB connection between two PC's and this was listed as only 5 mbit. My wireless network card claims it's 45 mbit most of the time. Still, I think you can get the performance data through WMI which should give you the bandwidth value and lots of other information.
0
 
LVL 17

Accepted Solution

by:
Wim ten Brink earned 2000 total points
ID: 12368063
I've done some search in WMI. You could use a 'select CurrentBandwidth, Name from Win32_PerfRawData_Tcpip_NetworkInterface' query in WMI to get the bandwidth per network controller. However, determining duplex mode is something I haven't found within WMI.

This code gets the bandwidth for all network cards:

uses
  Windows, SysUtils, Classes, ActiveX, ComObj, WbemScripting_TLB;

const
  sQuery = 'select CurrentBandwidth, Name from Win32_PerfRawData_Tcpip_NetworkInterface';
var
  Enum: IEnumVariant;
  Item: SWbemObject;
begin
  Enum := CoSWbemLocator.Create.ConnectServer( '', 'root\cimv2', '', '', '', '', 0, nil ).ExecQuery( sQuery, 'WQL', wbemFlagBidirectional, nil )._NewEnum as IEnumVariant;
  while NextItem( Enum, SWBemObject, Item ) do begin
    WriteLn( 'Network ', VarToStr( Item.Properties_.Item( 'Name', 0 ) ), ', bandwidth ', VarToStr( Item.Properties_.Item( 'CurrentBandwidth', 0 ) ) );
  end;
end;

WbemScripting_TLB is created by converting the C:\WINNT\system32\wbem\wbemdisp.tlb type library to Delphi. But for Delphi 7 I've already created a version at http://www.workshop-alex.org/Sources/WbemScripting_TLB.pas that can be used.
Now, all you need is the Duplex info. :-)
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses
Course of the Month10 days, 23 hours left to enroll

770 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