winfom获取应用程序当前路径
system.diagnostics.process.getcurrentprocess().mainmodule.filename;
//获取新的 process 组件并将其与当前活动的进程关联的主模块的完整路径,包含文件名(进程名)。
//返回 e:c#学习获取当前路径获取当前路径bindebug获取当前路径.exe system.appdomain.currentdomain.setupinformation.applicationbase;
//获取和设置包含该应用程序的目录的名称。
//返回 e:c#学习获取当前路径获取当前路径bindebug
system.windows.forms.application.startuppath;
//获取启动了应用程序的可执行文件的路径,不包括可执行文件的名称。
//返回 e:c#学习获取当前路径获取当前路径bindebug
system.windows.forms.application.executablepath;
//获取启动了应用程序的可执行文件的路径,包括可执行文件的名称。
//返回 e:c#学习获取当前路径获取当前路径bindebug获取当前路径.exe system.io.directory.getcurrentdirectory();
//获取应用程序的当前工作目录(不可靠)。
//返回 e:c#学习获取当前路径获取当前路径bindebug
this.gettype().assembly.location;
//获取当前进程的完整路径,包含文件名(进程名)。
//遗憾的静态方法无法使用
//返回 e:c#学习获取当前路径获取当前路径bindebug获取当前路径.exe
string path = ""; if (system.environment.currentdirectory == appdomain.currentdomain.basedirectory)//windows应用程序则相等 { path = appdomain.currentdomain.basedirectory; } else { path = appdomain.currentdomain.basedirectory + "bin"; }
c# webform 文件访问
string[] getdirectoryfiles(string dirvpath, string pattern)
{
string dirvpathrooted = string.concat(
httpcontext.current.request.applicationpath.tolower(),
dirvpath);
string dirpath = httpcontext.current.server.mappath(dirvpathrooted);string[] files = directory.getfiles(dirpath, pattern, searchoption.alldirectories);
string[] includes = new string[files.length];
for (int i = 0; i {
includes[i] = files[i]
.replace(dirpath, dirvpath) // replace physical root by virtual root
.replace('', '/');
}
return includes;
}
樱花校园模拟器4399中文版
樱花校园模拟器4399中文版,十分奇趣好玩的3d校园冒险模拟
我的暑假秘密回忆繁星新春版
我的暑假秘密回忆繁星新春版是一款少女模拟养成类休闲游戏。这款
樱花校园模拟器国际版
樱花校园模拟器国际版,一个超级自由超级好玩的自由恋爱模拟的游
饥荒海难九游版
饥荒海难九游版,带你去真实的海岛上感受一下什么才是真正的孤岛
盖瑞模组体验版最新版
盖瑞模组体验版是玩法非常丰富多元化的沙盒建造游戏,玩家可以在