日期:2014-05-17 浏览次数:20764 次
public static void EncryptFile(String fileIn, String fileOut, String Password)
{
FileStream fsIn = new FileStream(fileIn, FileMode.Open, FileAccess.Read);
FileStream fsOut = new FileStream(fileOut, FileMode.Create, FileAccess.Write);
CryptoStream cs = new CryptoStream(fsOut);
byte[] buffer = new byte[BUFSIZE];
int bytesRead;
while ((bytesRead = fsIn.Read(buffer, 0, BUFSIZE)) > 0)
{
cs.Write(buffer, 0, bytesRead);
}
cs.Close();
fsIn.Close();