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;
            }
        }
Ejemplo n.º 2
0
        private async void servernetworkchecktimer_Tick(object sender, EventArgs e)
        {
            try
            {
                nointernet = await MyNetworking.CheckForInternetConnection() ? false : true;
            }
            catch
            {
                nointernet = true;
            }


            if (!IsConnectionAvailable())
            {
                nointernet = true;
                netGone    = true;
            }
            if (nointernet)
            {
                netGone = true;
            }
        }
Ejemplo n.º 3
0
 private void getActiveCounters()
 {
     DownloadCounter = MyNetworking.DownloadCounter("down");
     UploadCounter   = MyNetworking.DownloadCounter("up");
 }