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"; /// /// 保存错误资源文件 /// /// /// 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(path, resx, null, true); } /// /// 获取 资源信息 /// /// 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(path).FirstOrDefault(); } } }