/// <summary> /// 尝试解密语言包文件(导入时用) /// </summary> /// <param name="AStrSourceFile"></param> /// <param name="AStrPassword"></param> /// <param name="AStrReturn"></param> /// <returns></returns> public bool TryDecryptionLanguagePackage(string AStrSourceFile, string AStrPassword, ref string AStrReturn) { bool LBoolReturn = true; string LStrSourceBody = string.Empty; try { IStrLanguagePackageBody = string.Empty; AStrReturn = string.Empty; LBoolReturn = VoiceCyberPrivate.DecryptFileToString(AStrSourceFile, AStrPassword, ref AStrReturn); if (LBoolReturn) { LBoolReturn = IsXMLTypeFileOrString("", AStrReturn); if (LBoolReturn) { LStrSourceBody = AStrReturn; LBoolReturn = SourceIsLanguagePackage(LStrSourceBody, ref AStrReturn); if (!LBoolReturn) { AStrReturn = "FileContentError"; } else { IStrLanguagePackageBody = LStrSourceBody; } } else { AStrReturn = "FileFormatError"; } } else { AStrReturn = "LanFileDecryptFailed"; } } catch { LBoolReturn = false; AStrReturn = "LanFileDecryptFailed"; } return(LBoolReturn); }
/// <summary> /// 尝试解密语言包文件(导入时用) /// </summary> /// <param name="AStrSourceFile"></param> /// <param name="AStrPassword"></param> /// <param name="AStrReturn"></param> /// <returns></returns> public static bool TryDecryptionLanguagePackage(string AStrSourceFile, string AStrPassword, ref string AStrReturn) { bool LBoolReturn = true; string LStrSourceBody = string.Empty; try { AStrReturn = string.Empty; LBoolReturn = VoiceCyberPrivate.DecryptFileToString(AStrSourceFile, AStrPassword, ref AStrReturn); if (LBoolReturn) { LBoolReturn = IsXMLTypeFileOrString("", AStrReturn); if (LBoolReturn) { LStrSourceBody = AStrReturn; LBoolReturn = SourceIsLanguagePackage(LStrSourceBody, ref AStrReturn); if (!LBoolReturn) { AStrReturn = "N013"; } else { } } else { AStrReturn = "N012"; } } else { AStrReturn = "N011"; } } catch { LBoolReturn = false; AStrReturn = "N011"; } return(LBoolReturn); }