| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172 |
- /*******************************************************************************
- * 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
- {
- /// <summary>
- /// 系统各种路径的取得
- /// </summary>
- 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 属性
- /// <summary>
- /// exe所在目录
- /// </summary>
- public static string ExePath
- {
- get;
- set;
- }
- /// <summary>
- /// INI文件路径(废弃)
- /// </summary>
- public static string INIFilePath
- {
- get;
- set;
- }
- /// <summary>
- /// INI文件路径
- /// </summary>
- public static string LocalINIFilePath
- {
- get;
- set;
- }
- /// <summary>
- /// exe log 所在目录
- /// </summary>
- public static string LogExePath
- {
- get;
- set;
- }
- /// <summary>
- /// 程序根目录的名称
- /// </summary>
- public static string RootPath
- {
- get;
- set;
- }
- /// <summary>
- /// 日志存放位置
- /// </summary>
- public static string LogRootPath
- {
- get;
- set;
- }
- /// <summary>
- /// 缓存存放位置
- /// </summary>
- public static string CacheRootPath
- {
- get;
- set;
- }
- /// <summary>
- /// 缓存文件名称
- /// </summary>
- public static string CacheFileName
- {
- get;
- set;
- }
- /// <summary>
- /// DataGridView设置存放位置
- /// </summary>
- public static string GridSettingRoot
- {
- get;
- set;
- }
- /// <summary>
- /// 保存DataGridView设置的文件名
- /// </summary>
- public static string GridSettingFileName
- {
- get;
- set;
- }
- /// <summary>
- /// 自动更新下载路径
- /// </summary>
- public static string InstallerDownloadPath
- {
- get;
- set;
- }
- public static string InstallerPublicDownloadPath
- {
- get;
- set;
- }
- /// <summary>
- /// 消息路径
- /// </summary>
- public static string MessagePath
- {
- get;
- set;
- }
- #endregion
- }
- }
|