feiyucha

实现效果:

  

知识运用:
  DirectoryInfo类的Create方法

  string对象的EndsWith方法

实现代码:

        private void button1_Click(object sender, EventArgs e)
        {
            FolderBrowserDialog FBDialog = new FolderBrowserDialog();
            if (FBDialog.ShowDialog() == DialogResult.OK)
            { 
                string strPath=FBDialog.SelectedPath;
                if (strPath.EndsWith("\\"))
                    textBox1.Text = strPath;
                else
                    textBox1.Text = strPath + "\\";
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            DirectoryInfo Dinfo = new DirectoryInfo(textBox1.Text+textBox2.Text);
            Dinfo.Create();
        }

  

分类:

技术点:

相关文章:

  • 2021-11-06
  • 2021-11-20
  • 2021-12-22
  • 2021-12-22
  • 2021-11-05
  • 2021-10-15
  • 2021-11-29
猜你喜欢
  • 2021-12-06
  • 2022-01-01
  • 2021-12-25
  • 2021-10-18
  • 2021-12-09
  • 2021-12-07
  • 2021-12-02
相关资源
相似解决方案