M
Maarten Weyn
Is there a way to get the signal strength of all surroundin access points in
c# on a vista pc?
regards
Maarten Weyn
c# on a vista pc?
regards
Maarten Weyn
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Peter Bromberg said:This might help, although I haven't used it:
public static int GetSignalStrengthAsInt()
{
Int32 returnStrength = 0;
ManagementObjectSearcher searcher = null;
try
{
// Query the management object with the valid scope and the
correct query statment
searcher = new ManagementObjectSearcher( @"root\WMI",
"select Ndis80211ReceivedSignalStrength from
MSNdis_80211_ReceivedSignalStrength where active=true" );
// Call the get in order to populate the collection
ManagementObjectCollection adapterObjects = searcher.Get();
// Loop though the management object and pull out the
signal
strength
foreach ( ManagementObject mo in adapterObjects )
{
returnStrength = Convert.ToInt32( mo[
"Ndis80211ReceivedSignalStrength" ].ToString() );
break;
}
}
catch ( Exception e )
{
}
finally
{
if ( searcher != null )
{
searcher.Dispose();
}
}
return returnStrength;
}
--
--Peter
"Inside every large program, there is a small program trying to get out."
http://www.eggheadcafe.com
http://petesbloggerama.blogspot.com
http://www.blogmetafinder.com
Maarten Weyn said:Is there a way to get the signal strength of all surroundin access points
in
c# on a vista pc?
regards
Maarten Weyn
Maarten Weyn said:This should work for WinXP, but it does not work for vista.
thanks anyway
Willy Denoyette said:Doesn't work is of little help, what error do you get when you run this?
Willy.
Maarten Weyn said:This should work for WinXP, but it does not work for vista.
thanks anyway
Peter Bromberg said:This might help, although I haven't used it:
public static int GetSignalStrengthAsInt()
{
Int32 returnStrength = 0;
ManagementObjectSearcher searcher = null;
try
{
// Query the management object with the valid scope and the
correct query statment
searcher = new ManagementObjectSearcher( @"root\WMI",
"select Ndis80211ReceivedSignalStrength from
MSNdis_80211_ReceivedSignalStrength where active=true" );
// Call the get in order to populate the collection
ManagementObjectCollection adapterObjects = searcher.Get();
// Loop though the management object and pull out the
signal
strength
foreach ( ManagementObject mo in adapterObjects )
{
returnStrength = Convert.ToInt32( mo[
"Ndis80211ReceivedSignalStrength" ].ToString() );
break;
}
}
catch ( Exception e )
{
}
finally
{
if ( searcher != null )
{
searcher.Dispose();
}
}
return returnStrength;
}
--
--Peter
"Inside every large program, there is a small program trying to get out."
http://www.eggheadcafe.com
http://petesbloggerama.blogspot.com
http://www.blogmetafinder.com
Maarten Weyn said:Is there a way to get the signal strength of all surroundin access points
in
c# on a vista pc?
regards
Maarten Weyn
Family Tree Mike said:It runs fine for me under Vista, though the values for strength I get are
negative. I'm not sure what that indicates.
The value is the signal level, expressed in dBm, relative to the 1 milliWatt
(0dBm) energy level.
The lower the value the lower the signal level, -10dBm =
xcellent ------> -100dBm too low to be usable.
Willy.
Peter Bromberg said:If you are having issues you could try this approach which runs netsh
under
the hood:
http://www.codeproject.com/gadgets/WifiScanner.asp
--Peter
"Inside every large program, there is a small program trying to get out."
http://www.eggheadcafe.com
http://petesbloggerama.blogspot.com
http://www.blogmetafinder.com
Maarten Weyn said:This should work for WinXP, but it does not work for vista.
thanks anyway
Peter Bromberg said:This might help, although I haven't used it:
public static int GetSignalStrengthAsInt()
{
Int32 returnStrength = 0;
ManagementObjectSearcher searcher = null;
try
{
// Query the management object with the valid scope and
the
correct query statment
searcher = new ManagementObjectSearcher( @"root\WMI",
"select Ndis80211ReceivedSignalStrength from
MSNdis_80211_ReceivedSignalStrength where active=true" );
// Call the get in order to populate the collection
ManagementObjectCollection adapterObjects =
searcher.Get();
// Loop though the management object and pull out the
signal
strength
foreach ( ManagementObject mo in adapterObjects )
{
returnStrength = Convert.ToInt32( mo[
"Ndis80211ReceivedSignalStrength" ].ToString() );
break;
}
}
catch ( Exception e )
{
}
finally
{
if ( searcher != null )
{
searcher.Dispose();
}
}
return returnStrength;
}
--
--Peter
"Inside every large program, there is a small program trying to get
out."
http://www.eggheadcafe.com
http://petesbloggerama.blogspot.com
http://www.blogmetafinder.com
:
Is there a way to get the signal strength of all surroundin access
points
in
c# on a vista pc?
regards
Maarten Weyn
funghy said:Thanks a lot,
the problem with that one is that the signal strength in % is more the
link quality and not the real RSSI value.
Thanks anyway
Peter Bromberg said:If you are having issues you could try this approach which runs netsh
under
the hood:
http://www.codeproject.com/gadgets/WifiScanner.asp
--Peter
"Inside every large program, there is a small program trying to get out."
http://www.eggheadcafe.com
http://petesbloggerama.blogspot.com
http://www.blogmetafinder.com
Maarten Weyn said:This should work for WinXP, but it does not work for vista.
thanks anyway
"Peter Bromberg [C# MVP]" <[email protected]> schreef in
bericht This might help, although I haven't used it:
public static int GetSignalStrengthAsInt()
{
Int32 returnStrength = 0;
ManagementObjectSearcher searcher = null;
try
{
// Query the management object with the valid scope and
the
correct query statment
searcher = new ManagementObjectSearcher( @"root\WMI",
"select Ndis80211ReceivedSignalStrength from
MSNdis_80211_ReceivedSignalStrength where active=true" );
// Call the get in order to populate the collection
ManagementObjectCollection adapterObjects =
searcher.Get();
// Loop though the management object and pull out the
signal
strength
foreach ( ManagementObject mo in adapterObjects )
{
returnStrength = Convert.ToInt32( mo[
"Ndis80211ReceivedSignalStrength" ].ToString() );
break;
}
}
catch ( Exception e )
{
}
finally
{
if ( searcher != null )
{
searcher.Dispose();
}
}
return returnStrength;
}
--
--Peter
"Inside every large program, there is a small program trying to get
out."
http://www.eggheadcafe.com
http://petesbloggerama.blogspot.com
http://www.blogmetafinder.com
:
Is there a way to get the signal strength of all surroundin access
points
in
c# on a vista pc?
regards
Maarten Weyn
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.