/*******************************************************************************
* Copyright(c) 2012 dongke All rights reserved. / Confidential
* 类的信息:
* 1.程序名称:LocalPath.cs
* 2.功能描述:系统各种路径的取得
* 编辑履历:
* 作者 日期 版本 修改内容
* 欧阳涛 2012/06/07 1.00 新建
*******************************************************************************/
using System;
using System.Text;
namespace Dongke.IBOSS.PRD.Basics.Library
{
///
/// 系统各种路径的取得
///
public class LocalPath
{
static LocalPath()
{
try
{
// 取得程序运行的路径
StringBuilder personalDataSavePath = new StringBuilder();
personalDataSavePath.Append(System.Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData));
personalDataSavePath.Append(@"\");
personalDataSavePath.Append(@"DongkeSoft\IBOSSPRD");
personalDataSavePath.Append(@"\");
// 根路径
RootPath = personalDataSavePath.ToString();
// 错误日志路径
LogRootPath = RootPath + @"Log\";
// 缓存路径&文件名
CacheRootPath = RootPath + @"CacheData\";
CacheFileName = CacheRootPath + "Cache_{0}.cache";
// DataGridView设置保存路径&文件名
GridSettingRoot = RootPath + @"GridSetting\";
GridSettingFileName = GridSettingRoot + "Grid_{0}_{1}.grid";
// 自动更新文件下载路径
InstallerDownloadPath = RootPath + @"UpDownload\";
// 自动更新文件下载路径
InstallerPublicDownloadPath = RootPath + @"UpPublicDownload\";
// 即时通讯本地存储
MessagePath = RootPath + @"Message\";
ExePath = System.AppDomain.CurrentDomain.BaseDirectory;
LogExePath = ExePath + @"Log\";
INIFilePath= LocalPath.RootPath + BaseResources.Constant.INI_FILE_NAME;
LocalINIFilePath = System.AppDomain.CurrentDomain.BaseDirectory + BaseResources.Constant.INI_FILE_NAME;
}
catch (Exception ex)
{
throw ex;
}
}
#region 属性
///
/// exe所在目录
///
public static string ExePath
{
get;
set;
}
///
/// INI文件路径(废弃)
///
public static string INIFilePath
{
get;
set;
}
///
/// INI文件路径
///
public static string LocalINIFilePath
{
get;
set;
}
///
/// exe log 所在目录
///
public static string LogExePath
{
get;
set;
}
///
/// 程序根目录的名称
///
public static string RootPath
{
get;
set;
}
///
/// 日志存放位置
///
public static string LogRootPath
{
get;
set;
}
///
/// 缓存存放位置
///
public static string CacheRootPath
{
get;
set;
}
///
/// 缓存文件名称
///
public static string CacheFileName
{
get;
set;
}
///
/// DataGridView设置存放位置
///
public static string GridSettingRoot
{
get;
set;
}
///
/// 保存DataGridView设置的文件名
///
public static string GridSettingFileName
{
get;
set;
}
///
/// 自动更新下载路径
///
public static string InstallerDownloadPath
{
get;
set;
}
public static string InstallerPublicDownloadPath
{
get;
set;
}
///
/// 消息路径
///
public static string MessagePath
{
get;
set;
}
#endregion
}
}