using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.ComponentModel;
using System.Reflection;
namespace LSKWDL.util
{
class GetCurrentPath
{
private string platform;
public string Platform
{
get { return Environment.OSVersion.Platform.ToString(); ; }
}
private string currentpath;
public string Currentpath
{
get
{
if (Platform.Equals("WinCE"))
{
return Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase) ;
}
else if (Platform.Equals("Win32NT"))
{
return Directory.GetCurrentDirectory();
}
return null;
}
}
}
}
wince 获取项目当前路径
最新推荐文章于 2019-12-27 17:15:06 发布
本文介绍了一段使用C#编程语言实现获取当前路径的方法,适用于不同平台(如WinCE和Win32NT),通过环境变量和Assembly类来获取执行文件所在的目录路径。
3124

被折叠的 条评论
为什么被折叠?



