コード例 #1
0
        private void cmb_SelectedIndexChanged(object sender, EventArgs e)
        {
            //set the new remote working directory

            //Set the current directory.
            try
            {
                Directory.SetCurrentDirectory(cmb.SelectedItem.ToString().Substring(0, 3));
                CLocal.FillLocalListView(lsVLocal);
                index = cmb.SelectedIndex;
            }
            catch (Exception e1)
            {
                MessageBox.Show("Lỗi !!! Không thể truy cập ổ đĩa " + cmb.SelectedItem.ToString().Substring(0, 3));
                cmb.SelectedIndex = index;
            }
        }
コード例 #2
0
        private void lsVLocal_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            String strFile;

            try
            {
                int t = lsVLocal.FocusedItem.Index;
            }
            catch (Exception e1)
            {
                return;
            }
            //get directory that user double-clicked
            strFile = lsVLocal.FocusedItem.Text;
            int iLen = strFile.Length;

            strFile = strFile.Replace(" <DIR>", "");
            if (strFile.Length == iLen)
            {
                return;
            }

            CLocal.FillLocalListView(lsVLocal, strFile);
        }