System.IO.Directory.GetCurrentDirectory();

解决方案 »

  1.   

    to TheAres(班门斧):
      提示:找不到类型或命名空间名称“Application”(是否缺少 using
    指令或程序集引用?)为什么?
      

  2.   

    我已经添加了:
    using System;
    using System.IO;
      

  3.   

    Application.ExecutablePath;
    using System.Windows.Forms;
      

  4.   

    我是在控制台上编译的,没有用到form,非要在winform中才能取得吗?
      

  5.   

    添加这个
    using System.Windows.Forms;
    后就行了,谢谢各位