日期:2014-05-17 浏览次数:21492 次
FileStream fs = new FileStream(filepath, FileMode.Create);
byte[] buffer = new byte[1024];
int size = InpStream.Read(buffer, 0, buffer.Length);
while (size > 0)
{
fs.Write(buffer, 0, size);
size = InpStream.Read(buffer, 0, buffer.Length);
}
#region 解压
/// <summary>
/// 功能:解压zip格式的文件。
/// </summary>
/// <param name="zipFilePath">压缩文件路径,全路径格式</param>
/// <param name="unZipDir">解压文件存放路径,全路径格式,为空时默认与压缩文件同一级目录下,跟压缩文件同名的文件夹</param>
/// <param name="err">出错信息</param>
/// <returns>解压是否成功</returns>
public static bool UnZip(string zipFilePath, string unZipDir, int maximum, SetProgressDelegate setProgressDelegate)
{
if (zipFilePath == string.Empty)
{
throw new DateTime.Now.ToString("yyyy/MM/dd")的有关问题