那有没有用wlanApi.dll这个的C#获取信号强度的

解决方案 »

  1.   

    有没有例子,不知道这个dll里边的接口是什么啊?
      

  2.   

    研究下这个源码,里面有一个"ConnectionClass.dll"类库,利用这个类库,可以方便的对无线网络进行操作.包括wifi信号强度,质量..
    http://www.codeproject.com/KB/gadgets/SignalStrenghth/SignalStrengthIndicator.zippublic static uint GetSignalQuality(Guid gg)
    {
        UInt32 dwSize = 0;
        IntPtr ppData = IntPtr.Zero;
        IntPtr ppChannel = IntPtr.Zero;
        WLAN_OPCODE_VALUE_TYPE pOpcodeValueType;    if (WlanQueryInterface(m_pClientHandle, ref gg, 
            WLAN_INTF_OPCODE.wlan_intf_opcode_current_connection, 
            IntPtr.Zero, out dwSize, out ppData, 
            out pOpcodeValueType) != ERROR_SUCCESS)
        {
            m_errorMessage = "Failed WlanQueryInterface() - " + 
                             "Current  Connection Attributes";
            return 0;
        }    if (ppData != IntPtr.Zero)
        {
            WLAN_CONNECTION_ATTRIBUTES connectionAttributes = 
                 new WLAN_CONNECTION_ATTRIBUTES(ppData);
            return connectionAttributes.wlanAssociationAttributes.wlanSignalQuality;    }
        return 0;
    }
      

  3.   

    C# 不具备处理这么底层的能力,如果不用第三方就用C/C++开发吧。
      

  4.   

    这怎么可能不用第三方,C# 没这么处理底层的能力,只能打点家务,外头的活得C、C++
      

  5.   

    有驱动的法,C#照样能干,C#既然能调用API,为什么不能调用驱动程序里的方法呢?
      

  6.   

    只能使用第三方的或者windows自带的组件吧。
      

  7.   

    可以用DOS命令  查阅  netsh wlan   资料
      

  8.   

    有木有同学给个C#连接wifi的理智看看
      

  9.   

    using System;
    using System.Diagnostics;namespace WifiTest
    {
        class Program
        {
            static void Main(string[] args)
            {
                Process proc = new Process();
                proc.StartInfo.CreateNoWindow = true;
                proc.StartInfo.FileName = "netsh";
                proc.StartInfo.Arguments = "wlan show networks mode=bssid";
                proc.StartInfo.RedirectStandardOutput = true;
                proc.StartInfo.UseShellExecute = false;
                proc.Start();
                string output = proc.StandardOutput.ReadToEnd();
                proc.WaitForExit();            Console.WriteLine(output);
                Console.Read();
            }
        }
    }