| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.IO;
- using System.Linq;
- using System.Resources;
- using System.Text;
- using System.Threading;
- using Muchinfo.MTPClient.Resources;
- //----------------------------------------------------------------
- //Module Name: $safeprojectname$
- //Purpose:
- //CopyRight: Muchinfo
- //History:
- //----------------------------------------------------------------
- //DateTime 2016/12/15
- //Author
- //Description Create
- //----------------------------------------------------------------
- using Muchinfo.PC.Common.Bosn;
- namespace Muchinfo.MTPClient.CustomException
- {
- public class ErrorCodeManager
- {
- private const string _fileName = "ErrorCodes.dll";
- /// <summary>
- /// 保存错误资源文件
- /// </summary>
- /// <param name="hastableResx"></param>
- /// <param name="ver"></param>
- public void SaveErrorCode(Hashtable hastableResx,ulong ver)
- {
- var resx = new CommonResx() { ResourceHashtable = hastableResx, Version = ver };
- string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, _fileName);
- JsonHelper.SaveData<CommonResx>(path, resx, null, true);
- }
- /// <summary>
- /// 获取 资源信息
- /// </summary>
- /// <returns></returns>
- public CommonResx GetErrorCode()
- {
- var resx = new CommonResx() { Version = 0 };
- string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, _fileName);
- if (!File.Exists(path))
- return resx;
- return JsonHelper.LoadData<CommonResx>(path).FirstOrDefault();
- }
-
- }
- }
|