Esempio n. 1
0
        //强制登出
        private void Logout(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            LogoutWindows l = new LogoutWindows();

            l.Title = "本机MAC:" + GetMac.GetMacAddressByNetworkInformation();
            l.Show();
        }
Esempio n. 2
0
        public string Get(GetMac request)
        {
            string result = MAC.GetActivatedAdaptorMacAddress();

            if (result == "0")
            {
                return(new FailResponse(result).ToString());
            }
            else
            {
                return(new OkResponse(result).ToString());
            }
        }
Esempio n. 3
0
        private void btGet_Click(object sender, EventArgs e)
        {
            string ip    = TextIp.Text;
            Regex  regex = new Regex("^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$");

            if (!regex.IsMatch(ip))
            {
                MessageBox.Show("输入一个无效的 IP 地址!", "提示");
                return;
            }
            GM            = new GetMac(ip);
            TextName.Text = GM.NAME;
            TextMac.Text  = GM.MAC;
            //TextMac.Text = GetMacAddress(ip);
            //lstWOL.Add(new Model.WOL(GM.MAC,GM.NAME,GM.IP));
        }
Esempio n. 4
0
    IEnumerator SignUp(string ID)
    {
        GetMac       Mac        = new GetMac();
        Synchronizer WebRequest = new Synchronizer();
        DataField    SendData   = new DataField()
        {
            CMD = CommandList.RegistID, ID = ID, MAC = Mac.MacAddress
        };

        StartCoroutine(WebRequest.Send(SendData));
        while (WebRequest.Status == 0)
        {
            yield return(new WaitForSeconds(0.1f));
        }

        if (WebRequest.Status == 1)
        {
            string GetData = WebRequest.ResponceText;

            if (int.Parse(GetData) == 1)
            {
                PlayerPrefs.SetString("ID", ID);
                PlayerPrefs.Save();             //계정 정보를 저장
                GameObject Msgbox = Instantiate(Resources.Load("GUI/Window/MessageBox", typeof(GameObject)), GameObject.Find("Canvas").transform) as GameObject;
                Msgbox.GetComponent <MessageBoxScript>().ShowMessageBox("등록 완료", "메시지");
                GameObject.Find("GameStartBtn").GetComponent <Button>().interactable = true;
                GameObject.Find("HelpBtn").GetComponent <Button>().interactable      = true;
                GameObject.Find("ExitGameBtn").GetComponent <Button>().interactable  = true;
                Destroy(transform.gameObject);
            }
            else if (int.Parse(GetData) == 0)
            {
                GameObject Msgbox = Instantiate(Resources.Load("GUI/Window/MessageBox", typeof(GameObject)), GameObject.Find("Canvas").transform) as GameObject;
                Msgbox.GetComponent <MessageBoxScript>().ShowMessageBox("이미 존재하는 닉네임 입니다...등록 오류", "오류");
            }
            else if (int.Parse(GetData) == -1)
            {
                GameObject Msgbox = Instantiate(Resources.Load("GUI/Window/MessageBox", typeof(GameObject)), GameObject.Find("Canvas").transform) as GameObject;
                Msgbox.GetComponent <MessageBoxScript>().ShowMessageBox("시스템 오류...", "오류");
            }
        }
    }