Example #1
0
 private void lv_allinfo_DoubleClick(object sender, EventArgs e)
 {//ListView双击
     try
     {
         string FullName = lv_allinfo.SelectedItems[0].Tag.ToString();       //获得选中项的全部名称
         if (lv_allinfo.SelectedItems[0].ImageIndex == 1)                    //如果选中的是txt
         {
             EditTxt dlgEditTxt = new EditTxt();
             dlgEditTxt.lb_fullname.Text = FullName;
             dlgEditTxt.ShowDialog(this);
         }
         else
         {
             if (lv_allinfo.SelectedItems[0].ImageIndex == 2)        //如果选中的是其他文件
             {
                 System.Diagnostics.Process.Start(FullName);         //通过系统函数启动该文件
             }
             else
             {
                 tb_currentpath.Text = FullName;         //更新路径显示
                 FillFilesView(FullName);                //更新ListView
                 CurPath.Add(FullName);                  //将当前路径存入CurPath
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Example #2
0
        private void lv_allinfo_DoubleClick(object sender, EventArgs e)
        {//ListView双击
            //在这里肯定可以收到authority的值了
            if (authority == "0")
            {
                只显示秘密文件ToolStripMenuItem.Enabled = false;
                只显示机密文件ToolStripMenuItem.Enabled = false;
                只显示绝密文件ToolStripMenuItem.Enabled = false;

                contextmenudelete.Enabled = false; //设置秘密
                copy.Enabled = false;              //设置机密
                cut.Enabled  = false;              //设置绝密
            }
            else if (authority == "1")
            {
                只显示机密文件ToolStripMenuItem.Enabled = false;
                只显示绝密文件ToolStripMenuItem.Enabled = false;

                copy.Enabled = false; //设置机密
                cut.Enabled  = false; //设置绝密
            }
            else if (authority == "2")
            {
                只显示绝密文件ToolStripMenuItem.Enabled = false;

                cut.Enabled = false;  //设置绝密
            }

            try
            {
                string FullName = lv_allinfo.SelectedItems[0].Tag.ToString();       //获得选中项的全部名称
                if (lv_allinfo.SelectedItems[0].ImageIndex == 1)                    //如果选中的是txt
                {
                    EditTxt dlgEditTxt = new EditTxt();
                    dlgEditTxt.lb_fullname.Text = FullName;
                    dlgEditTxt.ShowDialog(this);
                }
                else
                {
                    if (lv_allinfo.SelectedItems[0].ImageIndex == 2)        //如果选中的是其他文件
                    {
                        System.Diagnostics.Process.Start(FullName);         //通过系统函数启动该文件
                    }
                    else
                    {
                        tb_currentpath.Text = FullName;         //更新路径显示
                        FillFilesView(FullName);                //更新ListView
                        CurPath.Add(FullName);                  //将当前路径存入CurPath
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }