Exemple #1
0
        private void LoginForm_Shown(object sender, EventArgs e)
        {
            //if (File.Exists(this.appdata_path + "SN_pref.txt"))
            if (File.Exists(Path.Combine(Directory.GetCurrentDirectory(), "SN_pref.txt")))
            {
                this.txtUser.Focus();

                List <ModelMacData> mac = GetMac.GetMac.GetMACAddress();
                this.G.current_mac_address = mac.First <ModelMacData>().macAddress.Replace(":", "-");
            }
            else
            {
                ApiMainUrlFirstSetting wind = new ApiMainUrlFirstSetting();
                if (wind.ShowDialog() == DialogResult.OK)
                {
                    List <ModelMacData> mac = GetMac.GetMac.GetMACAddress();
                    this.G.current_mac_address = mac.First <ModelMacData>().macAddress.Replace(":", "-");
                }
                else
                {
                    this.Close();
                }
            }
        }
Exemple #2
0
        private void LoginForm_Shown(object sender, EventArgs e)
        {
            //if (File.Exists(this.appdata_path + "SN_pref.txt"))
            if(File.Exists(Path.Combine(Directory.GetCurrentDirectory(), "SN_pref.txt")))
            {
                this.txtUser.Focus();

                List<ModelMacData> mac = GetMac.GetMac.GetMACAddress();
                this.G.current_mac_address = mac.First<ModelMacData>().macAddress.Replace(":", "-");
            }
            else
            {
                ApiMainUrlFirstSetting wind = new ApiMainUrlFirstSetting();
                if (wind.ShowDialog() == DialogResult.OK)
                {
                    List<ModelMacData> mac = GetMac.GetMac.GetMACAddress();
                    this.G.current_mac_address = mac.First<ModelMacData>().macAddress.Replace(":", "-");
                }
                else
                {
                    this.Close();
                }
            }
        }