private void button1_Click(object sender, EventArgs e)
        {
            string DirectoryName    = "/ModuleLib";
            string localFileLibPath = Application.StartupPath + "/" + DirectoryName + "/";//  加反斜杠

            string homePath = controllerA.FileSystem.RemoteDirectory;

            // Console.WriteLine(root);
            // path:/hd0a/120-504462/HOME
            if (false == DirectoriesControl.CheckDirectoryExists(DirectoryName, 0))
            {
                controllerA.FileSystem.CreateDirectory(DirectoryName);
                MessageBox.Show("检查到目录不存在,当前已初始化完毕,重新执行以开始····");
            }
            else
            {
            }
        }
Beispiel #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            string selectFileName = listBox2_fileStore.SelectedItem.ToString();

            try
            {
                if (true == DirectoriesControl.IsDirectory(selectFileName))
                {
                    controller.FileSystem.RemoveDirectory(selectFileName);
                }
                else
                {
                    controller.FileSystem.RemoveFile(selectFileName);
                } // 控制器绝对路径 listBox2_fileStore.SelectedItem.ToString()
                label2_INFO.Text = "文件已删除,其文件(夹)名:" + selectFileName + "---" + $"文件列表已刷新";
                this.button1_Click(null, null); // 刷新
                setInfoColor(Color.FromArgb(30, 144, 255), Color.FromArgb(248, 248, 255));
            }
            catch (NullReferenceException ex) { label2_INFO.Text = (ex.Message + "....删除失败!"); setInfoColor(Color.FromArgb(205, 38, 38), Color.FromArgb(248, 248, 255)); }
        }