Esempio n. 1
0
        private void bgwPinger_DoWork(object sender, DoWorkEventArgs e)
        {
            Network net = Program.net.CloneElement();
            bool    res = net.PushPing(MID);

            UpdatePing(res == true ? "Online" : "Not connected", res);

            if (res == true && UsersLoaded == false && Settings.Default.ShowActiveUsers == true)
            {
                List <PushRunningSessionElement> sessions = Program.net.PushGetSessions(MID);
                if (sessions != null)
                {
                    PComputerData pc = (PComputerData)PropertiesG.SelectedObject;

                    foreach (PushRunningSessionElement s in sessions)
                    {
                        if (string.IsNullOrWhiteSpace(pc.OneUser) == true)
                        {
                            if (s.SessionID != 0)
                            {
                                if (string.IsNullOrWhiteSpace(s.Domain) == true)
                                {
                                    pc.OneUser = s.User;
                                }
                                else
                                {
                                    pc.OneUser = s.Domain + "\\" + s.User;
                                }
                            }
                        }

                        if (s.SessionID != 0)
                        {
                            if (string.IsNullOrWhiteSpace(s.Domain) == true)
                            {
                                pc.LoggedInUsers.Add(s.SessionID + " - " + s.User);
                            }
                            else
                            {
                                pc.LoggedInUsers.Add(s.SessionID + " - " + s.Domain + "\\" + s.User);
                            }
                        }
                    }

                    pc.NumberOfUsers = pc.LoggedInUsers.Count;
                    if (pc.NumberOfUsers == 0)
                    {
                        pc.OneUser = "******";
                    }

                    UsersLoaded = true;
                }
            }
        }
Esempio n. 2
0
        private void frmComputerInfo_Load(object sender, EventArgs e)
        {
            data             = Program.net.GetComputerDetail(MID);
            lblPing.Text     = "Status pending ..";
            lblWUReboot.Text = lblWUStatus.Text = "";
            picStatus.Image  = Resources.Help.ToBitmap();
            if (data == null)
            {
                this.Text = "Computer Information: ???";
                return;
            }

            Program.LoadImageList(TVImgList);

            PComputerData transformeddata = new PComputerData();

            ClassCopy.CopyClassData(data, transformeddata);
            ((PComputerData)transformeddata).IOSVerType         = ((ComputerData)data).OSVerType;
            ((PComputerData)transformeddata).OSWin10Edition     = Win10Version.GetWin10Version(transformeddata.OSVersion);
            ((PComputerData)transformeddata).BMeteredConnection = data.IsMeteredConnection;
            ((PComputerData)transformeddata).RunningInWindowsPE = data.RunningInWindowsPE;

            if (Settings.Default.ShowActiveUsers == false)
            {
                transformeddata.OneUser = "******";
            }

            PropertiesG.SelectedObject = transformeddata;

            this.Text = "Computer information: " + data.Computername;

#if !ENABLECHAT
            tabControl1.TabPages.Remove(tabPage6);
#endif

            AddTab(new ctlServices(MID), "Services");
            AddTab(new ctlEventLogs(MID), "Event Log");
            AddTab(new ctlAddRemovePrograms(MID), "Programs");
            AddTab(new ctlListDiskData(MID), "Disk");
            AddTab(new ctlListNetworkConfig(MID), "Network");
            AddTab(new ctlDevices(MID), "Devices");
            AddTab(new ctlDevicesFilter(MID), "Filter Drivers");
            AddTab(new ctlBitlockerRK(MID), "Bitlocker Recovery");
            AddTab(new ctlWindowsLicense(MID), "Windows License");
            AddTab(new ctlFileTransfer(MID), "File transfer");
            AddTab(new ctlStartupItems(MID), "Startup Items");
            AddTab(new ctlSMARTInfo(MID), "SMART Data");
            AddTab(new ctlSimpleTasks(MID), "Simple Tasks");

            timerPinger_Tick(null, null);

            lstRemotePort.Items.Add("HTTP");
            lstRemotePort.Items.Add("RDP");
            lstRemotePort.Items.Add("HTTPS");
            lstRemotePort.Items.Add("SSH");
            lstRemotePort.Items.Add("SMTP");
            lstRemotePort.Items.Add("POP3");
            lstRemotePort.Items.Add("IMAP");
            lstRemotePort.Items.Add("TELNET");

            LoadPolicies();
        }