获取系统当前目录

实现效果:

  

知识运用:

  Environment类的CurrentDirectory属性    //获取或设置当前工作目录的完全限定路径

  public static string CurrentDirectory {get;  set;}

实现代码:

        private void button1_Click(object sender, EventArgs e)
        {
            textBox1.Text = Environment.CurrentDirectory;
        }

猜你喜欢

转载自www.cnblogs.com/feiyucha/p/10236205.html