zoukankan      html  css  js  c++  java
  • 修改磁盘格式

    实现效果:

      

    知识运用:

      Dos命令: "/c convert 盘符 /fs:ntfs"

    实现代码:

            private void button1_Click(object sender, EventArgs e)
            {
                DriveInfo Dinfo = new DriveInfo(comboBox1.Text);
                textBox1.Text = Dinfo.DriveFormat;
                if (textBox1.Text == "NTFS")
                    button2.Enabled = false;
                else if (textBox1.Text == "FAT32")
                    button2.Enabled = true;
            }
    
            private void button2_Click(object sender, EventArgs e)
            {
                System.Diagnostics.Process myProcess = new System.Diagnostics.Process();
                myProcess.StartInfo.FileName = "cmd.exe";
                myProcess.StartInfo.Arguments = "/c convert "+textBox1.Text+" /fs:ntfs";
                myProcess.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;    //隐藏窗口
                myProcess.StartInfo.UseShellExecute = false;
                myProcess.StartInfo.RedirectStandardError = true;
                myProcess.StartInfo.RedirectStandardInput = true;
                myProcess.StartInfo.RedirectStandardOutput = true;
                myProcess.StartInfo.CreateNoWindow = true;
                myProcess.Start();
                myProcess.WaitForExit();                                                //执行完退出
            }
    

      

  • 相关阅读:
    FCN 分割网络详解
    ResNet 结构理解
    使用 Estimator 构建卷积神经网络
    Object Detection Review
    MP 及OMP算法解析
    Docker 使用及常用命令
    采用std::thread 替换 openmp
    模型优化,汇总
    图像几何变换
    多线程下C#如何保证线程安全?
  • 原文地址:https://www.cnblogs.com/feiyucha/p/10305821.html
Copyright © 2011-2022 走看看