打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
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);
        }
    }
}

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
如何获得运行程序的路径
C#中substring ()的用法
JSP、Java 获取当前绝对路径
c#动态加载程序集
C#获取执行程序所在的当前路径的方法
Windows 服务程序 配置文件路径问题
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服