C#:如何获取安装文件所在的路径
2007-04-23 10:56
399 查看
using System;
using System.Collections.Generic;
using System.Text;
namespace MyConAPP
{
class Program
{
static void Main(string[] args)
{
string strFullAppName = System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase;
if (strFullAppName.ToLower().IndexOf("file:///") >= 0)
{
strFullAppName = strFullAppName.Substring(8, strFullAppName.Length - 8);
}
string strAppPath = System.IO.Path.GetDirectoryName(strFullAppName);
Console.WriteLine(strAppPath);
}
}
}
using System.Collections.Generic;
using System.Text;
namespace MyConAPP
{
class Program
{
static void Main(string[] args)
{
string strFullAppName = System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase;
if (strFullAppName.ToLower().IndexOf("file:///") >= 0)
{
strFullAppName = strFullAppName.Substring(8, strFullAppName.Length - 8);
}
string strAppPath = System.IO.Path.GetDirectoryName(strFullAppName);
Console.WriteLine(strAppPath);
}
}
}
相关文章推荐
- C#获取安装程序所在的路径
- 在python中,如何获取脚本文件所在路径
- 如何获取MAC App Atore下载的安装文件路径
- C# Winform中如何获取文件路径
- 如何在PocketPC中获取应用程序所在的路径(C#)
- 在python中,如何获取脚本文件所在路径-2
- 在python中,如何获取脚本文件所在路径
- C# Winform中如何获取文件路径
- C# 获取制定文件所在路径
- C# Winform中如何获取文件名与文件路径
- 如何获取dll文件所在路径?
- c# windows服务如何获取自己的安装路径
- WIN服务 winservice 中 获取安装文件所在路径
- 安卓安装完应用后,如何获取包的meta-inf目录下的文件?
- 【C#学习笔记】获取当前应用程序所在路径及环境变量
- C#获取当前应用程序所在的路径
- c++判断文件是否存在,判断是文件还是目录,获取文件大小,获取程序所在路径
- C#获取文件路径的几种方法
- C#获取当前应用程序所在路径及环境变量
- 算法积累:解决如何获取指定文件夹路径或者文件路径下所有子文件后缀为.h .m .c的文本的行数