| | |
| | | { |
| | | public class PathHelper |
| | | { |
| | | /// <summary> |
| | | /// 程序目录 |
| | | /// </summary> |
| | | public static string AppFolder { get; private set; } = RootPath(); |
| | | |
| | | /// <summary> |
| | | /// 图标目录 |
| | | /// </summary> |
| | | public static string IconFolder { get; private set; } |
| | | |
| | | /// <summary> |
| | | /// Config目录 |
| | | /// </summary> |
| | | public static string ConfigFolder { get; private set; } |
| | | |
| | | /// <summary> |
| | | /// Sqlite数据库目录 |
| | | /// </summary> |
| | | public static string DatabaseFolder { get; private set; } |
| | | |
| | | /// <summary> |
| | | /// Sqlite数据库Path |
| | | /// </summary> |
| | | public static string DatabasePath { get; private set; } |
| | | |
| | | /// <summary> |
| | | /// 多语言目录 |
| | | /// </summary> |
| | | public static string LangFolder { get; private set; } |
| | | |
| | | /// <summary> |
| | | /// 系统设置目录 |
| | | /// </summary> |
| | | public static string SettingFolder { get; private set; } |
| | | |
| | | /// <summary> |
| | | /// 参数目录 |
| | | /// </summary> |
| | | public static string ParameterFolder { get; private set; } |
| | | |
| | | /// <summary> |
| | | /// 参数数据源文件 |
| | | /// </summary> |
| | | public static string ParameterDataPath { get; private set; } |
| | | |
| | | /// <summary> |
| | | /// 产品数据目录 |
| | | /// </summary> |
| | | public static string ProductDataFolder { get; private set; } |
| | | public static string ProductParameterFolder { get; private set; } |
| | | |
| | | /// <summary> |
| | | /// 产品数据源文件 |
| | | /// </summary> |
| | | public static string ProductDataFile { get; private set; } |
| | | |
| | | /// <summary> |
| | | /// 测试项数据目录 |
| | | /// </summary> |
| | | public static string TestItemDataFolder { get; private set; } |
| | | |
| | | /// <summary> |
| | | /// 测试项数据源文件 |
| | | /// </summary> |
| | | public static string TestItemDataFile { get; private set; } |
| | | |
| | | /// <summary> |
| | | /// sqlite日志数据库文件夹 |
| | | /// </summary> |
| | | public static string LogViewerDir { get; private set; } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 应用程序的根目录 |
| | |
| | | DatabasePath = DatabaseFolder + "\\database.db"; |
| | | LangFolder = InitFolder(path + "\\Lang"); |
| | | SettingFolder = InitFolder(ConfigFolder + "\\SystemSetting"); |
| | | ParameterFolder = InitFolder(ConfigFolder + "\\Parameter"); |
| | | ParameterDataPath = ParameterFolder + "\\CommonParameter.data"; |
| | | |
| | | ProductDataFolder = InitFolder(ConfigFolder + "\\Product"); |
| | | ProductParameterFolder = InitFolder(ProductDataFolder + "\\Parameter"); |
| | | ProductDataFile = ProductDataFolder + "\\Product.data"; |
| | | |
| | | TestItemDataFolder = InitFolder(ProductDataFolder + "\\TestItem"); |
| | | TestItemDataFile = TestItemDataFolder + "\\TestItem.data"; |
| | | |
| | | LogViewerDir = InitFolder(ConfigFolder + "\\LogViewer"); |
| | | return path; |
| | | } |
| | | |
| | |
| | | return Path; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 设置参数文件夹 |
| | | /// </summary> |
| | | /// <returns>设置参数文件夹</returns> |
| | | public static string ParameterFolder() |
| | | public static string BlockAlarmSettingPath() |
| | | { |
| | | string Path = ProductionFolder() + "\\Parameter"; |
| | | string Path = RootPath() + "\\Config\\AlarmInfo\\BlockSetting.xml"; |
| | | return Path; |
| | | } |
| | | |
| | | public static string MarkAlarmSettingPath() |
| | | { |
| | | string Path = RootPath() + "\\Config\\AlarmInfo\\MarkSetting.xml"; |
| | | return Path; |
| | | } |
| | | |
| | |
| | | Directory.CreateDirectory(path); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | catch |
| | | { |
| | | |
| | | } |