• 大小: 625KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-06
  • 语言: 其他
  • 标签: wifi小车  

资源简介

wifi小车上位机程序代码,是在平板电脑上的应用程序可以连接WIFI小车

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using NativeWifi;
using System.Runtime.InteropServices;
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using System.Collections;

namespace 爱科思小车代理
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        [DllImport(“wininet.dll“)]
        public static extern bool InternetGetConnectedState(out long lpdwFlags long dwReserved);

        static string GetStringForSSID(Wlan.Dot11Ssid ssid)
        {
            return Encoding.ASCII.GetString(ssid.SSID 0 (int)ssid.SSIDLength);
        }
        Wlan.WlanAvailableNetwork[] wlanAvailableNetworks;
        private void refresh()
        {
            listView1.Items.Clear();
            WlanClient wlanClientTmp = new WlanClient();
            if (wlanClientTmp.Interfaces.Length != 0)
            {
                WlanClient.WlanInterface wlanInterfaceTmp = wlanClientTmp.Interfaces[0];
                Wlan.WlanAvailableNetwork[] wlanAvailableNetworksTmp
                    = wlanInterfaceTmp.GetAvailableNetworkList(Wlan.WlanGetAvailableNetworkFlags.IncludeAllAdhocProfiles);
                wlanAvailableNetworks = wlanAvailableNetworksTmp;
                int i = 1;
                foreach (Wlan.WlanAvailableNetwork wlanAvailableNetworkTmp in wlanAvailableNetworksTmp)
                {
                    ListViewItem lviTmp = new ListViewItem(
                        new string[]{   
                        (i++).ToString()
                        GetStringForSSID(wlanAvailableNetworkTmp.dot11Ssid)
                        wlanAvailableNetworkTmp.wlanSignalQuality.ToString() + “%“
                        wlanAvailableNetworkTmp.networkConnectable.ToString()
                        wlanAvailableNetworkTmp.securityEnabled.ToString()
                        Convert.ToInt64(wlanAvailableNetworkTmp.flags).ToString()
                        }
                    );
                    listView1.Items.Add(lviTmp);
                }
            }
        }

        private void wlanInterfaceTmp_WlanConnectionNotification(Wlan.WlanNotificationData notifyData Wlan.WlanConnectionNotificationData connNotifyData)
        {
            if (connNotifyData.profileName != ““)
            {
                
                label1.Text = “已连接至:“ + connNotifyData.profileName;
            }
        }
        private void listView1_MouseDoubleClick(object sender MouseEventArgs e)
        {
            try
            {
                WlanClient wlanClientTmp = new WlanClient();

                if (wlanClientTmp.Interfaces.Length != 0)
                {
                    WlanClient.WlanInterface wlanInterfaceTmp = wlanClientTmp.Interfaces[0];
  

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      23549  2013-01-21 11:22  爱科思小车代理1\Backup\爱科思小车代理\Form1.cs

     文件      30954  2013-01-21 10:00  爱科思小车代理1\Backup\爱科思小车代理\Form1.Designer.cs

     文件     142024  2013-01-21 10:00  爱科思小车代理1\Backup\爱科思小车代理\Form1.resx

     文件      59824  2013-01-06 14:33  爱科思小车代理1\Backup\爱科思小车代理\Interop.cs

     文件        502  2013-01-06 14:25  爱科思小车代理1\Backup\爱科思小车代理\Program.cs

     文件       1384  2013-01-06 14:25  爱科思小车代理1\Backup\爱科思小车代理\Properties\AssemblyInfo.cs

     文件       2892  2013-01-06 14:25  爱科思小车代理1\Backup\爱科思小车代理\Properties\Resources.Designer.cs

     文件       5612  2013-01-06 14:25  爱科思小车代理1\Backup\爱科思小车代理\Properties\Resources.resx

     文件       1106  2013-01-06 14:25  爱科思小车代理1\Backup\爱科思小车代理\Properties\Settings.Designer.cs

     文件        249  2013-01-06 14:25  爱科思小车代理1\Backup\爱科思小车代理\Properties\Settings.settings

     文件      28943  2013-01-06 14:33  爱科思小车代理1\Backup\爱科思小车代理\WlanApi.cs

     文件       4148  2013-01-06 18:41  爱科思小车代理1\Backup\爱科思小车代理\爱科思小车代理.csproj

     文件        953  2013-01-06 14:25  爱科思小车代理1\Backup\爱科思小车代理.sln

    ..A..H.     16896  2013-01-20 22:38  爱科思小车代理1\Backup\爱科思小车代理.v11.suo

     文件      27042  2013-04-08 09:37  爱科思小车代理1\UpgradeLog.htm

     文件       6896  2013-04-08 09:37  爱科思小车代理1\UpgradeLog.xml

     文件       2229  2013-04-08 09:37  爱科思小车代理1\_UpgradeReport_Files\UpgradeReport.css

     文件      22214  2012-07-26 20:25  爱科思小车代理1\_UpgradeReport_Files\UpgradeReport.xslt

     文件        397  2013-04-08 09:37  爱科思小车代理1\_UpgradeReport_Files\UpgradeReport_Error.png

     文件        338  2013-04-08 09:37  爱科思小车代理1\_UpgradeReport_Files\UpgradeReport_Information.png

     文件        381  2013-04-08 09:37  爱科思小车代理1\_UpgradeReport_Files\UpgradeReport_Success.png

     文件        292  2013-04-08 09:37  爱科思小车代理1\_UpgradeReport_Files\UpgradeReport_Warning.png

     文件      21504  2013-01-06 18:31  爱科思小车代理1\爱科思小车代理\bin\Debug\GlassButton.dll

     文件     143872  2013-04-08 14:19  爱科思小车代理1\爱科思小车代理\bin\Debug\爱科思小车代理.exe

     文件      87552  2013-04-08 14:19  爱科思小车代理1\爱科思小车代理\bin\Debug\爱科思小车代理.pdb

     文件      22472  2013-04-08 14:41  爱科思小车代理1\爱科思小车代理\bin\Debug\爱科思小车代理.vshost.exe

     文件        490  2010-03-17 22:39  爱科思小车代理1\爱科思小车代理\bin\Debug\爱科思小车代理.vshost.exe.manifest

     文件      23549  2013-01-21 11:22  爱科思小车代理1\爱科思小车代理\Form1.cs

     文件      30954  2013-01-21 10:00  爱科思小车代理1\爱科思小车代理\Form1.Designer.cs

     文件     142024  2013-01-21 10:00  爱科思小车代理1\爱科思小车代理\Form1.resx

............此处省略37个文件信息

评论

共有 条评论