예제 #1
0
 private void StartStopButton_Click(object sender, EventArgs e)
 {
     if (IsNetworkStarted == false)
     {
         Hotspot.Start();
         ConnectedUsersTimer.Start();
         SetThreadExecutionState(ES_CONTINUOUS | ES_SYSTEM_REQUIRED);
     }
     else
     {
         Hotspot.Stop();
         ConnectedUsersTimer.Stop();
         SetThreadExecutionState(ES_CONTINUOUS);
     }
     UpdateLabelsText();
 }
예제 #2
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            ReadSettings();
            UpdateLabelsText();
            ConnectedUsersTimer.Start();
            ContextMenu NotificationMenu = new ContextMenu();
            MenuItem    Item1            = new MenuItem
            {
                Index = 0,
                Text  = "Show Program"
            };

            Item1.Click += Item1_Click;
            MenuItem Item2 = new MenuItem
            {
                Index = 1,
                Text  = "Exit"
            };

            Item2.Click += Item2_Click;
            NotificationMenu.MenuItems.Add(Item1);
            NotificationMenu.MenuItems.Add(Item2);
            notifyIcon1.ContextMenu = NotificationMenu;
            if (IOkey.ReadLicence() == false)
            {
                RegisterButton.PerformClick();
            }
            else
            {
                LoggerClass.WriteLogInformation("Licence Verified" + Environment.NewLine + "Program Started");
                RegisterButton.Visible = false;
            }
            if (NetworkInfo.NetworkStatus == "Started")
            {
                LoggerClass.WriteLogInformation("Hotspot Started");
            }
            else
            {
                LoggerClass.WriteLogInformation("Hotspot Not Started");
            }
        }