`
byebyegov5qq
  • 浏览: 1217664 次
文章分类
社区版块
存档分类
最新评论

c# wince 获取程序当前路径

 
阅读更多

using System;

using System.Collections.Generic;
using System.Text;
using System.Reflection;
using System.IO;

namespace Austec.ToolCollection
{
public class App
{

// 获取程序当前路径
public static string GetPath()
{
string fullAppName = Assembly.GetExecutingAssembly().GetName().CodeBase;
string fullAppPath = Path.GetDirectoryName(fullAppName);
if (fullAppPath.StartsWith("file:"))
{
fullAppPath = fullAppPath.Substring(6);
}
if ( fullAppPath.Substring(fullAppPath.Length-1,1)!="//")
{
fullAppPath += "//";
}
return (fullAppPath);
}
}
}

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics