C 獲取專案當前路徑

2021-06-05 20:55:20 字數 412 閱讀 7915

//獲取應用程式的當前工作目錄。

string path1 = system.io.directory.getcurrentdirectory();

console.writeline(path1.tostring());

//~\apolloautotest\testresults\123\out

//~\apolloautotest\apolloautotest\bin\debug

//~\apolloautotest\apolloautotest\bin\debug

//~\querymachineuser\querymachineuser\bin\debug

//~\querymachineuser\querymachineuser\bin\debug\querymachineuser.exe

C 獲取當前路徑

c 獲取當前路徑的7種方法 c 獲取當前路徑的方法如下 1.system.diagnostics.process.getcurrentprocess mainmodule.filename 獲取模組的完整路徑。2.system.environment.currentdirectory 獲取和設定當前...

C 獲取檔案當前路徑

1.system.diagnostics.process.getcurrentprocess mainmodule.filename 獲取模組的完整路徑。2.system.environment.currentdirectory 獲取和設定當前目錄 該程序從中啟動的目錄 的完全限定目錄。3.syst...

C 獲取當前路徑方法

獲取模組的完整路徑。string path1 system.diagnostics.process.getcurrentprocess mainmodule.filename 獲取和設定當前目錄 該程序從中啟動的目錄 的完全限定目錄 string path2 system.environment.c...