/// <summary>
/// 默认构造函数
/// </summary>
/// <param name="filepath">资源文件路径</param>
public ResourceHelper(string filepath)
{
this.m_FilePath = filepath;
this.m_Hashtable = new Hashtable();
//如果存在
if (File.Exists(filepath))
{
string tempFile = HConst.TemplatePath + "\\decryptFile.resx";
//解密文件
//System.Net.Security tSecurity = new Security();
//tSecurity.DecryptDES(filepath, tempFile);
File.Copy(filepath, tempFile);
using (ResourceReader ResReader = new ResourceReader(tempFile))
{
IDictionaryEnumerator tDictEnum = ResReader.GetEnumerator();
while (tDictEnum.MoveNext())
{
this.m_Hashtable.Add(tDictEnum.Key, tDictEnum.Value);
}
ResReader.Close();
}
//删除临时文件
File.Delete(tempFile);
}
}