Ejemplo n.º 1
0
        /*  FORM LOAD.................................................*/
        private async void Form1_Load(object sender, EventArgs e)
        {
            //   MyNetworking.getLineSpeed();
            string path = "SabirsDigitalClockYourName.sabir";

            //RegistryKey registryKey = Registry.CurrentUser.OpenSubKey
            //("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);

            //if (registryKey.GetValue("DigitalMonitor") == null)
            //{
            //    registryKey.SetValue("DigitalMonitor", Application.ExecutablePath);
            //}

            //Initializing Active Adapters for getting download upload
            IniNetwork(pcg);

            /*getting User Name */
            var name = Recurse();

            File.WriteAllText(path, name);

            if (name == "" || String.IsNullOrEmpty(name))
            {
                namelabel.Text = NAME;
            }
            else
            {
                namelabel.Text = name;
            }

            //  #if DEBUG
            systraynotifyicon.Visible        = true;
            systraynotifyicon.BalloonTipText = "DM has started\nFor monitoring the system.";
            systraynotifyicon.ShowBalloonTip(500);
            //#endif
            TotalRam             = (int)(getTotalRam() / 1024);
            ActiveNetworkAdapter = MyNetworking.ActiveNetworkInterface();
            try
            {
                if (await MyNetworking.CheckForInternetConnection())
                {
                    SSID       = getSSID();
                    nointernet = false;
                }
                else
                {
                    SSID       = "No Internet";
                    nointernet = true;
                }
            }
            catch
            {
                SSID       = "No Internet";
                nointernet = true;
            }
        }