using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using ShareWifi.Utils.Net; using ShareWifi.Views.Components; using ShareWifi.Model; namespace ShareWifi.Views { public partial class Home : UserControl { WifiModel wifiModel; public Home() { InitializeComponent(); } public static Home getInstance() { return new Home(); } public override bool Equals(object obj) { return obj is Home home && EqualityComparer.Default.Equals(wifiModel, home.wifiModel); } private void btnGenerate_Click(object sender, EventArgs e) { string ssid = WifiUtils.getSSID(); if (ssid != "" || ssid != null) { //查找密码 string v = WifiUtils.getSSDIPassword(ssid); //生成二维码 btnGenerate.Text = v; } else { SimpleAlert simpleAlert = SimpleAlert.getInstance(); simpleAlert.Show("请链接 WIFI 后才可以分享!"); } } } }