Reversible

static void SaveMSIToTxt(string fileNameSoucre, string fileNameDest)
{
byte[] bytes = System.IO.File.ReadAllBytes(fileNameSoucre);
string str = Convert.ToBase64String(bytes);
System.IO.File.WriteAllText(fileNameDest, str);
}

static void ExtractMSIFromTxt(string txtFileName, string msiFileName)
{
string str = System.IO.File.ReadAllText(txtFileName);
byte[] bytes = Convert.FromBase64String(str);
FileStream fs
= new FileStream(msiFileName, FileMode.Create);
BinaryWriter bw
= new BinaryWriter(fs);
bw.Write(bytes);
bw.Close();
fs.Close();
}
原文地址:https://www.cnblogs.com/cnbwang/p/2095238.html