Exemplo n.º 1
0
        public ALEmanCafeClient(ALEmanCafe AC)
        {
            InitializeComponent();
            this.AC = AC;
            int PCNumber = 0;

            try
            {
                PCNumber = int.Parse(Regex.Match(Environment.UserName, @"\d+").Value);//int.Parse(Environment.UserName);
            }
            catch { }
            if (PCNumber >= 1)
            {
                this.label1.Text = "Computer Number : " + PCNumber;
            }
            else
            {
                this.label1.Text = Environment.UserName + ", IP: " + ALEmanCafe.MyIp;
            }


            this.FormClosing += new FormClosingEventHandler(ALEmanCafeClient_FormClosing);
            this.KeyDown     += new KeyEventHandler(ALEmanCafeClient_KeyDown);
            this.MouseClick  += new MouseEventHandler(ALEmanCafeClient_MouseClick);
            this.LF           = new LoginForm(this.AC, this);
        }
Exemplo n.º 2
0
        public static List <AppInfo> GetRunningAppsInfo(ALEmanCafe AC)
        {
            List <AppInfo> AppsInfo = new List <AppInfo>();

            foreach (Process p in Program.GetRunningApps(AC))
            {
                try
                {
                    AppInfo AI = new AppInfo();
                    AI.AppICon  = Icon.ExtractAssociatedIcon(p.MainModule.FileName);
                    AI.AppName  = p.ProcessName;
                    AI.AppPath  = p.MainModule.FileName;
                    AI.AppTitle = p.MainWindowTitle;
                    AI.APPID    = p.Id;
                    AppsInfo.Add(AI);
                }
                catch (Exception e)
                {
                    if (AC != null)
                    {
                        AC.writeamess("Error 1 : " + e.ToString() + Environment.NewLine);
                    }
                }
            }
            return(AppsInfo);
        }
Exemplo n.º 3
0
        public static List <Process> GetRunningApps(ALEmanCafe AC)
        {
            List <Process> Pc = new List <Process>();

            try
            {
                Process[] processes = Process.GetProcesses();
                foreach (Process p in processes)
                {
                    if (p.ProcessName.ToLower() == "explorer" ||
                        p.ProcessName.ToLower() == "devenv" ||
                        p.ProcessName == Application.ProductName
                        )
                    {
                        continue;
                    }

                    if (!string.IsNullOrEmpty(p.MainWindowTitle))
                    {
                        Pc.Add(p);
                    }
                }
            }
            catch (Exception e)
            {
                if (AC != null)
                {
                    AC.writeamess("Error 2 : " + e.ToString() + Environment.NewLine);
                }
            }
            return(Pc);
        }
 public LoginForm(ALEmanCafe AC, ALEmanCafeClient ACC)
 {
     InitializeComponent();
     this.ACC = ACC;
     this.AC  = AC;
     this.PassTextBox.UseSystemPasswordChar = true;
     this.UserTextBox.KeyPress += new KeyPressEventHandler(UserTextBox_KeyPress);
     this.PassTextBox.KeyPress += new KeyPressEventHandler(PassTextBox_KeyPress);
     //    this.FormClosing += new FormClosingEventHandler(LoginForm_FormClosing);
 }