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();
        }

  

分类:

技术点:

相关文章:

  • 2022-02-09
  • 2022-01-06
  • 2022-01-01
  • 2021-11-17
  • 2021-11-30
  • 2021-11-29
  • 2022-01-14
  • 2021-11-30
猜你喜欢
  • 2021-12-23
  • 2021-12-06
  • 2022-01-01
  • 2021-12-25
  • 2021-12-02
  • 2022-12-23
  • 2021-11-20
相关资源
相似解决方案