Q:

Detect wifi connectivity in c#

I am working on an asp.net (or winforms) app that is supposed to detect wifi connectivity and strength. The intention is to provide the field agents with an indicator that they can connect to our main office
What would I need to detect wifi connectivity?  

A:

You can't do it in ASP.NET.  ASP.NET is a server-side technology which renders client-side browsable code.
In order to do this, you would have to develop something that is embedded in the page (ActiveX, Java, Flash, Silverlight) and even then, you would have to have the appropriate security permissions from the user to access the APIs necessary to access the wifi antenna.

A:

Take a look at WlanEnumInterfaces in the wlanapi.dll.  You will have to pinvoke it from C#.  There is a managed wrapper for it on Codeplex (http://managedwifi.codeplex.com), but I can't vouch for it as I've never used it personally.
You can still do with with ASP.Net if you don't mind writing an ActiveX object and your clients don't mind running it from your web site.

