(原創) 如何得知目前執行檔所在的目錄? (.NET) (C#)

C#

/* 
(C) OOMusou 2007 
http://oomusou.cnblogs.com

Filename    : GetCurrentDirectory.cs
Compiler    : Visual Studio 2005 / C# 2.0
Description : Demo how to get current directory of executable
Release     : 09/29/2007 1.0
*/

using System;
using System.IO;

class Client {
  
static void Main() {
    
string path = Directory.GetCurrentDirectory();
    Console.WriteLine(path);
  }

}


執行結果

D:\__Clare\CSharp\CSharpLab\bin\Release

posted on 2007-09-29 15:10  真 OO无双  阅读(1312)  评论(0编辑  收藏  举报

导航