Exemple #1
0
 private void btnOK_Click(object sender, EventArgs e)
 {
     UserName = edtUserName.Text;
     Password = DHuy.HideFood(edtPassword.Text, "RELOGON", new byte[256]);
     Res      = 1;
     this.Close();
 }
Exemple #2
0
 private void PCSList_Load(object sender, EventArgs e)
 {
     dt                      = DHuy.SELECT_SQL("SELECT TOP 2000 * FROM PCS ORDER BY ID DESC ");
     dgv.DataSource          = dt;
     dgv.AutoGenerateColumns = false;
     dgv.AutoResizeColumns();
 }
Exemple #3
0
        private void RunCMD_Load(object sender, EventArgs e)
        {
            String command = "CLIPBOARD;" + "";

            DHuy.AddCommand(SESSION_ID, command);
            Clipboard.Clear();
        }
Exemple #4
0
        //SEND/RECEIVE
        private void SEND(object sender, EventArgs e)
        {
            DataTable dt = DHuy.SELECT_SQL("SELECT * FROM FILE_TRANSFER WHERE ID = " + SESSION_TRANS_ID);

            if (DBase.IsFolder(HerePath) == 1)
            {
                return;
            }

            if (dt.Rows.Count > 0)
            {
                FileTransfer_Process P = new FileTransfer_Process();
                P.isSend           = 1;
                P.dt               = dt;
                P.Here_File        = HerePath;
                P.Remote_File      = RemotePath;
                P.SESSION_TRANS_ID = SESSION_TRANS_ID;
                P.F        = this;
                P.Location = new Point(Location.X + (Width - P.Width) / 2, Location.Y + (Height - P.Height) / 2);
                P.Show();
            }
            else
            {
                Confirm C = new Confirm();
                C.SetColor(Color.LightCoral);
                C.edtText.Text  = "Session is expired ! ... Close ? ";
                C.StartPosition = FormStartPosition.Manual;
                C.Location      = new Point(Location.X + (Width - C.Width) / 2, Location.Y + (Height - C.Height) / 2);
                C.ShowDialog(this);
                if (C.Res == 1)
                {
                    this.Close();
                }
            }
        }
 public void RefreshSelect()
 {
     try
     {
         string    ID   = DBase.StringReturn(dgv.SelectedRows[0].Cells[colKEYCOL].Value);
         DataTable temp = DHuy.SELECT(TableName, KEYCOL, ID.ToString());
         if (dt != null)
         {
             try
             {
                 DBase.TablePropertyRemove(dt);
                 for (int d = 0; d < dt.Rows.Count; d++)
                 {
                     if (dt.Rows[d][KEYCOL].ToString() == ID.ToString())
                     {
                         dt.Rows[d].ItemArray = temp.Rows[0].ItemArray;
                         break;
                     }
                 }
             }
             catch (Exception ex) { }
         }
     }
     catch (Exception ex) { }
 }
Exemple #6
0
        private void bgw_DoWork(object sender, System.ComponentModel.DoWorkEventArgs e)
        {
            isbusy = 1;
            try
            {
                if (isSend == 1)
                {
                    byte[] file_data = System.IO.File.ReadAllBytes(Here_File);

                    dt.Rows[0]["FILE_DATA"] = file_data;
                    kq = DHuy.UPDATE("FILE_TRANSFER", dt, "ID", "FILE_DATA");
                    dt.Rows[0]["SEND_STATUS"] = 1;
                    kq = DHuy.UPDATE("FILE_TRANSFER", dt, "ID", "SEND_STATUS");
                    DHuy.AddCommand_Trans(SESSION_TRANS_ID, "FILE_TRANSFER_RECEIVE;" + Remote_File + ";" + Here_FileName);
                }
                else
                {
                    if (Here_File == "Home")
                    {
                        Here_File = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
                    }
                    DHuy.DownloadFile("FILE_TRANSFER", "FILE_DATA", "ID", SESSION_TRANS_ID, Here_File + "\\" + Path.GetFileName(Remote_File));
                }
            }
            catch (Exception ex) { }
        }
        private void lbText_DoubleClick(object sender, EventArgs e)
        {
            if (isFolder == 1)
            {
                if (isRemote == 0)
                {
                    F.HereLastPath = F.HerePath;
                    F.HerePath     = PATH;
                    F.REFRESH1();
                }

                else
                {
                    DHuy.AddCommand_Trans(F.SESSION_TRANS_ID, "FILE_TRANSFER_OPEN;" + F.SESSION_TRANS_ID + ";" + PATH);
                }
            }
            else
            {
                try
                {
                    System.Diagnostics.Process.Start(PATH);
                }
                catch (Exception ex) { }
            }
        }
 private void bgw_DoWork(object sender, System.ComponentModel.DoWorkEventArgs e)
 {
     try
     {
         DHuy.CheckAndUpdateFile(FileName, true);
     }
     catch (Exception ex) { }
 }
Exemple #9
0
        private void panChat_DragDrop(object sender, DragEventArgs e)
        {
            try
            {
                if (e.Data.GetDataPresent(DataFormats.FileDrop))
                {
                    var files = (string[])e.Data.GetData(DataFormats.FileDrop);
                    foreach (var filePath in files)
                    {
                        FileInfo F        = new FileInfo(filePath);
                        int      isfolder = DBase.IsFolder(filePath);
                        if (isfolder == 1)
                        {
                            continue;
                        }
                        byte[] content = new byte[3];
                        content = System.IO.File.ReadAllBytes(filePath);
                        dtitem.Rows[0]["TYPE"]      = F.Extension;
                        dtitem.Rows[0]["FILENAME"]  = F.Name;
                        dtitem.Rows[0]["THUMBNAIL"] = new byte[3];

                        if (F.Extension.ToUpper() == ".JPG" || F.Extension.ToUpper() == ".PNG" || F.Extension.ToUpper() == ".BMP" || F.Extension.ToUpper() == ".GIF")
                        {
                            try
                            {
                                dtitem.Rows[0]["THUMBNAIL"] = DBase.ImageToByte(DBase.ResizeImage(Image.FromFile(filePath), 50, 50));
                            }
                            catch (Exception ex) { continue; }
                        }
                        else
                        {
                            try
                            {
                                dtitem.Rows[0]["THUMBNAIL"] = DBase.ImageToByte(Icon.ExtractAssociatedIcon(filePath).ToBitmap());
                            }
                            catch (Exception ex) { continue; }
                        }


                        dtitem.Rows[0]["TEXT"]      = Text;
                        dtitem.Rows[0]["CDATETIME"] = DHuy.GetServerTime();
                        dtitem.Rows[0]["FILEDATA"]  = content;
                        int kq = DHuy.INSERT_IDENTITY("CHAT", dtitem);
                        if (kq > 0)
                        {
                            edtChat.Focus();
                            edtChat.Text = "";
                            RefreshChat_Append();
                        }
                    }
                }
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
        private void BundleConfig_Load(object sender, EventArgs e)
        {
            DataTable dtcheck      = DHuy.SELECT_SQL("SELECT * FROM USER_PCS WHERE ID = " + ID + "");
            String    bundleString = DBase.StringReturn(dtcheck.Rows[0]["BUNDLESTRING"]);

            PCS_ID             = DBase.IntReturn(dtcheck.Rows[0]["PCS_ID"]);
            edtPCS_ID.Text     = PCS_ID.ToString();
            edtBundleList.Text = bundleString;
        }
Exemple #11
0
 public void ChatLoad()
 {
     timer1.Start();
     dtitem = DHuy.SELECT_NEWROW("CHAT");
     ResetInfoID();
     RefreshChat();
     edtChat.Focus();
     this.ActiveControl = edtChat;
 }
Exemple #12
0
        private void cmsDeletePCS_Click(object sender, EventArgs e)
        {
            int kq = DHuy.RUN_SQL("DELETE CHAT WHERE ID =" + ID);

            if (kq > 0)
            {
                M.RefreshChat();
            }
        }
Exemple #13
0
        public void Translate()
        {
            int Pic = Ran.Next(1, 6);

            if (Pic == 1)
            {
                edtPic.Image = Properties.Resources.Loading;
            }
            else if (Pic == 2)
            {
                edtPic.Image = Properties.Resources.Loading;
            }
            else if (Pic == 3)
            {
                edtPic.Image = Properties.Resources.Loading2;
            }
            else if (Pic == 4)
            {
                edtPic.Image = Properties.Resources.Loading2;
            }
            else if (Pic == 5)
            {
                edtPic.Image = Properties.Resources.Loading4;
            }

            edtAutoText.Text   = "";
            edtResultText.Text = "";
            KEYWORD            = edtKey.Text.Replace("(", "").Replace(")", "").Replace(",", "");
            if (DBase.TargetLanguage1 == "vi")
            {
                DT = DHuy.SELECT_SQL("SELECT * FROM ENVN WHERE EN = '" + KEYWORD + "'");
            }
            else
            {
                DT.Clear();
            }
            if (DT.Rows.Count == 1)
            {
                edtWordFound.Text = KEYWORD;
                string R = DBase.StringReturn(DT, 0, "VN").Replace("<br />", Environment.NewLine);
                DisplayResult(R, true);
            }
            else
            {
                edtWordFound.Text = "Google Translate ... ";
                //edtRESULTLABEL.Text = "";
                //edtResultText.Text = "Not found";
                //google API
                if (isbusy == 0)
                {
                    isbusy         = 1;
                    edtPic.Visible = true;
                    edtPic.BringToFront();
                    W1.RunWorkerAsync();
                }
            }
        }
Exemple #14
0
 private void FileExplorer_Load(object sender, EventArgs e)
 {
     try
     {
         kq = DHuy.AddCommand_Trans(SESSION_TRANS_ID, "FILE_TRANSFER_INIT;" + SESSION_TRANS_ID);
         HOME1_Click(null, null);
         timer1.Start();
         this.Text = "Session : " + SESSION_TRANS_ID + " - " + CONTROL_ID + " --> " + REMOTE_ID;
     }
     catch (Exception ex) { }
 }
Exemple #15
0
 private void lbText_DoubleClick(object sender, EventArgs e)
 {
     M.edtRemoteID.Text = PCS_ID.ToString();
     M.NameInList       = PCS_NAME;
     if (PASS != "")
     {
         M.RemotePassword = DHuy.OpenFood(PASS, "ForTheWin", new byte[256]);
     }
     M.REMOTE(PCS_ID, M.RemotePassword, PCS_NAME, 0);
     M.RemotePassword = "";
 }
        private static IntPtr KeyboardHookHandler(int nCode, IntPtr wParam, ref KBHookStruct lParam)
        {
            if (nCode == 0)
            {
                if (((lParam.vkCode == 0x09) && (lParam.flags == 0x20)) || // Alt+Tab
                    ((lParam.vkCode == 0x1B) & (lParam.flags == 0x20)) ||  // Alt+Esc
                    ((lParam.vkCode == 0x1B) & (lParam.flags == 0x00)) ||  // Ctrl+Esc
                    ((lParam.vkCode == 0x5B) && (lParam.flags == 0x01)) || // Left Windows Key
                    ((lParam.vkCode == 0x5C) && (lParam.flags == 0x01)) || // Right Windows Key
                    ((lParam.vkCode == 0x73) && (lParam.flags == 0x20)) || // Alt+F4 // Process at keydown
                    ((lParam.vkCode == 0x20) && (lParam.flags == 0x20)))   // Alt+Space
                {
                    if (((lParam.vkCode == 0x5B) && (lParam.flags == 0x01)) || ((lParam.vkCode == 0x5C) && (lParam.flags == 0x01)))
                    {
                        DBase.isWindowKeyDown = 1;
                        string cmd = "RUN_WINDOW_KEY;";
                        if (DBase.CurrentSessionID > 0)
                        {
                            DHuy.AddCommand(DBase.CurrentSessionID, cmd);
                        }
                    }

                    if (((lParam.vkCode == 0x73) && (lParam.flags == 0x20)))
                    {
                        string cmd = "RUN_ALT_F4;";
                        DHuy.AddCommand(DBase.CurrentSessionID, cmd);
                    }


                    if (((lParam.vkCode == 0x09) && (lParam.flags == 0x20)))
                    {
                        string cmd = "RUN_ALT_TAB;";
                        if (DBase.CurrentSessionID > 0)
                        {
                            DHuy.AddCommand(DBase.CurrentSessionID, cmd);
                        }
                    }


                    if (((lParam.vkCode == 0x1B) & (lParam.flags == 0x00)))
                    {
                        string cmd = "RUN_ESCAPE;";
                        if (DBase.CurrentSessionID > 0)
                        {
                            DHuy.AddCommand(DBase.CurrentSessionID, cmd);
                        }
                    }


                    return(new IntPtr(1));
                }
            }
            return(CallNextHookEx(hookPtr, nCode, wParam, ref lParam));
        }
Exemple #17
0
 private void bgw_RunWorkerCompleted1(object sender, System.ComponentModel.RunWorkerCompletedEventArgs e)
 {
     isbusy             = 0;
     progressBar1.Style = ProgressBarStyle.Blocks;
     progressBar1.Value = progressBar1.Maximum / 2;
     if (isSend == 0)
     {
         DHuy.RUN_SQL("UPDATE FILE_TRANSFER SET SEND_STATUS = 0 , RECEIVE_STATUS=0 WHERE ID = " + SESSION_TRANS_ID);
         isClose = 1;
         this.Close();
     }
 }
        private void Save_Click(object sender, EventArgs e)
        {
            foreach (Control C in this.Controls)
            {
                if (C.GetType() == typeof(PictureBox))
                {
                    try
                    {
                        try
                        {
                            dt.Rows[0][C.Name.Replace("edt", "")] = new byte[3];
                            dt.Rows[0][C.Name.Replace("edt", "")] = DBase.ImageToByte(((PictureBox)C).Image);
                        }
                        catch (Exception ex)
                        {
                            dt.Rows[0][C.Name.Replace("edt", "")] = DBase.ImageToByte(Properties.Resources.GoogleTrans24);
                        }
                    }
                    catch (Exception ex) { }
                }
            }

            int kq = 0;

            if (type == 0 || Clone == 1)
            {
                kq = (int)DHuy.INSERT_IDENTITY_RETURNID(TableName, dt);
                if (kq > 0)
                {
                    DBase.DTAPP = DHuy.SELECT_SQL("SELECT APPNAME,ENABLE,SHORTKEY,DOUBLECLICK,HOLDCLICK FROM APPTRANSLATE WHERE USERCODE ='ADMIN'");
                    //MessageBox.Show("Insert Succesful!");
                    if (Parent != null)
                    {
                        Parent.RefreshInsert(kq.ToString());
                    }
                    this.Close();
                }
            }
            else if (type == 1)
            {
                kq = DHuy.UPDATE(TableName, dt, KEYCOL);
                if (kq > 0)
                {
                    DBase.DTAPP = DHuy.SELECT_SQL("SELECT APPNAME,ENABLE,SHORTKEY,DOUBLECLICK,HOLDCLICK FROM APPTRANSLATE WHERE USERCODE ='ADMIN'");
                    //MessageBox.Show("Saved!");
                    if (Parent != null)
                    {
                        Parent.RefreshSelect();
                    }
                    this.Close();
                }
            }
        }
Exemple #19
0
        private void cmsDeletePCS_Click(object sender, EventArgs e)
        {
            Confirm C = new Confirm();

            C.StartPosition = FormStartPosition.CenterScreen;
            C.edtText.Text  = "Delete ?";
            C.ShowDialog();
            if (C.Res == 1)
            {
                DHuy.DELETE("USER_PCS", ID);
                M.RefreshPCS();
                M.panRight.Visible = true;
            }
        }
Exemple #20
0
        private void Save_Click(object sender, EventArgs e)
        {
            foreach (Control C in this.Controls)
            {
                if (C.GetType() == typeof(PictureBox))
                {
                    try
                    {
                        try
                        {
                            dt.Rows[0][C.Name.Replace("edt", "")] = new byte[3];
                            dt.Rows[0][C.Name.Replace("edt", "")] = DBase.ImageToByte(((PictureBox)C).Image);
                        }
                        catch (Exception ex)
                        {
                        }
                    }
                    catch (Exception ex) { }
                }
            }

            int kq = 0;

            if (type == 0 || Clone == 1)
            {
                kq = (int)DHuy.INSERT_IDENTITY(TableName, dt);
                if (kq > 0)
                {
                    MessageBox.Show("Insert Succesful!");
                    if (Parent != null)
                    {
                        Parent.RefreshInsert(kq.ToString());
                    }
                    this.Close();
                }
            }
            else if (type == 1)
            {
                kq = DHuy.UPDATE(TableName, dt, KEYCOL);
                if (kq > 0)
                {
                    MessageBox.Show("Saved!");
                    if (Parent != null)
                    {
                        Parent.RefreshSelect();
                    }
                    this.Close();
                }
            }
        }
        private void btnOK_Click(object sender, EventArgs e)
        {
            int kq = DHuy.RUN_SQL("UPDATE USER_PCS SET BUNDLESTRING= '" + edtBundleList.Text + "' WHERE ID = " + ID);

            if (kq > 0)
            {
                if (M != null)
                {
                    M.RefreshPCS();
                }
                M.panRight.Visible = true;
                this.Close();
            }
        }
Exemple #22
0
        private void cmsUpdate_Click(object sender, EventArgs e)
        {
            string app     = "UpdateFireP.exe";
            string ExeName = System.IO.Path.GetFileName(Application.ExecutablePath);

            String tempPath = System.Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\" + app;

            DHuy.DownloadFile(app, tempPath);
            try
            {
                System.Diagnostics.Process.Start(tempPath, ExeName.ToLower().Replace(".exe", "") + " JustClickSee.exe" + " \"" + Application.ExecutablePath + "\"");
            }
            catch (Exception ex) { }
        }
        private void edtPic_Click(object sender, EventArgs e)
        {
            DataTable dtd      = DHuy.SELECT_SQL("SELECT FILEDATA,FILENAME FROM Chat WHERE ID = " + ID);
            string    filename = DBase.StringReturn(dtd.Rows[0]["FILENAME"]);

            byte[] Data     = (byte[])dtd.Rows[0]["FILEDATA"];
            String SaveFile = Application.StartupPath + "\\" + filename;

            File.WriteAllBytes(SaveFile, Data);
            try
            {
                System.Diagnostics.Process.Start(SaveFile);
            }
            catch (Exception ex) { }
        }
Exemple #24
0
 private void BGLoading(object sender, System.ComponentModel.DoWorkEventArgs e)
 {
     try
     {
         dt = DHuy.SELECT_SQL("SELECT * FROM LANGUAGE");
         DBase.AddColumn(dt, "ICON", typeof(Image));
         for (int i = 0; i < dt.Rows.Count; i++)
         {
             DBase.SetValue(dt, i, "ICON", Properties.Resources.Trans16);
         }
     }
     catch (Exception) { }
     finally
     {
     }
 } //Action
Exemple #25
0
        private void Config_Load(object sender, EventArgs e)
        {
            try
            {
                edtPassword.Text = DHuy.OpenFood(DBase.PasswordAuthen, "justicenzy", new byte[64]);
                edtNickName.Text = DBase.NickName;

                if (DBase.AutoLogOn == "1")
                {
                    edtAutoLogon.Checked = true;
                }
                if (DBase.WallChange == 1)
                {
                    edtWallPapper.Checked = true;
                }
                if (DBase.ActiveTranslation == 1)
                {
                    edtActiveTranslator.Checked = true;
                }
                edtIntervalWall.Text = DBase.StringReturn(DBase.WallChangeSecond);

                if (DBase.LockDesktopWhenSessionFinish == "1")
                {
                    edtLockAfterSession.Checked = true;
                }
                if (DBase.AutoupdateWhenStart == "1")
                {
                    edtAutoUpdateWhenStart.Checked = true;
                }
                if (DBase.DisableAreoThemWhenConnect == "1")
                {
                    edtDisableAreo.Checked = true;
                }
                if (DBase.SoundDeviceText == "")
                {
                    edtSoundDevice.Text = "Headphone,Speakers";
                }
                else
                {
                    edtSoundDevice.Text = DBase.SoundDeviceText;
                }
                edtDisableWindowsLock.Checked = DBase.RegistryGetCU("Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer", "NoLogoff") == "1" ? true : false; // DBase.RegistrySetCU("Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer", "NoLogoff", "1", true);
            }
            catch (Exception ex) { }
        }
Exemple #26
0
 //TIMER
 private void FILE_TRANSFER_LIST_Tick(object sender, EventArgs e)
 {
     try
     {
         DataTable da = DHuy.SELECT_SQL("SELECT MD5 FROM FILE_TRANSFER WHERE ID = " + SESSION_TRANS_ID + " ORDER BY CDATETIME ASC ");
         if (da.Rows.Count > 0)
         {
             string md5 = DBase.StringReturn(da.Rows[0]["MD5"]);
             if (md5 != Remote_File_MD5)
             {
                 Remote_File_MD5 = md5;
                 DHuy.DownloadFile("FILE_TRANSFER", "DATA", "ID", SESSION_TRANS_ID, DBase.XmlRemote_File);
                 REFRESH2();
             }
         }
     }
     catch (Exception ex) { }
 }
Exemple #27
0
        private void edtEdit_Click(object sender, EventArgs e)
        {
            PCS_Detail A = new PCS_Detail();

            A.lbWelcome.Text   = "Edit";
            A.ID               = ID;
            A.USERCODE         = USERCODE;
            A.isUpdate         = 1;
            A.edtPass.Text     = DHuy.OpenFood(PASS, "ForTheWin", new byte[256]);
            A.edtPCS_NAME.Text = PCS_NAME;
            A.edtPCS_ID.Text   = PCS_ID.ToString();
            A.ShowDialog();
            if (A.Res == 1)
            {
                M.RefreshPCS();
                M.panRight.Visible = true;
            }
        }
 public void RefreshInsert(string ID)
 {
     try
     {
         DataTable temp = DHuy.SELECT(TableName, KEYCOL, ID.ToString());
         if (dt != null)
         {
             try
             {
                 DBase.TablePropertyRemove(dt);
                 DataRow dr = dt.NewRow();
                 dr.ItemArray = temp.Rows[0].ItemArray;
                 dt.Rows.Add(dr);
             }
             catch (Exception ex) { }
         }
     }
     catch (Exception ex) { }
 }
Exemple #29
0
 private void bgw_DoWork(object sender, System.ComponentModel.DoWorkEventArgs e)
 {
     isbusy = 1;
     try
     {
         if (LoadAll == true)
         {
             dt = DHuy.SELECT_SQL("SELECT  * FROM " + TableName);
         }
         else
         {
             dt = DHuy.SELECT_SQL("SELECT Top 300 *  FROM " + TableName);
         }
     }
     catch (Exception ex)
     {
         //    MessageBox.Show(ex.ToString());
     }
 }
Exemple #30
0
        private void LOGIN_Click(object sender, EventArgs e)
        {
            UserName       = edtName.Text;
            lbWelcome.Text = " Love you! ";
            DataTable dt = DHuy.SELECT_SQL("SELECT * FROM USERS WHERE USERCODE = '" + edtName.Text + "' AND PASSWORD = '******'");

            if (dt.Rows.Count > 0)
            {
                Res = 1;
                DBase.LastUserLogin     = edtName.Text;
                DBase.LastUserLogin2    = DBase.LastUserLogin;
                DBase.LastPasswordLogin = edtPass.Text;
                DBase.SaveSetting();
                this.Close();
            }
            else
            {
                lbWelcome.Text = " Name/Password is incorrect!";
            }
        }