string sourceFilePath = @"E:\文件拷贝\xx\3773\3773.zip";

 FileInfo fileInfo = new FileInfo(sourceFilePath);
long length = fileInfo.Length; if (length == )
{
return;
} using (ZipInputStream zip = new ZipInputStream(File.OpenRead(sourceFilePath)))
{
ZipEntry theEntry;
string destinationDirPath = @"\\172.21.3.21\liung\";
while ((theEntry = zip.GetNextEntry()) != null)
{
destinationDirPath += theEntry.Name; using (FileStream streamWriter = new FileStream(destinationDirPath, FileMode.Create, FileAccess.Write, FileShare.Read | FileShare.Write))
{
byte[] bytes = new byte[zip.Length];
zip.Read(bytes, , bytes.Length);
streamWriter.Write(bytes, , bytes.Length);
} XmlTextReader xmlReader = new XmlTextReader(zip);
while (xmlReader.Read())
{
if (xmlReader.NodeType == XmlNodeType.Element && xmlReader.Name.ToLower() == "fileheader")
{
string reportTime = xmlReader.GetAttribute("reportTime").Replace("24:00:00", "23:59:59");
string startTime = xmlReader.GetAttribute("startTime").Replace("24:00:00", "23:59:59");
string endTime = xmlReader.GetAttribute("endTime").Replace("24:00:00", "23:59:59"); break;
}
}
}
} Console.ReadKey(); using (GZipInputStream zip = new GZipInputStream(File.OpenRead(sourceFilePath)))
{
using (XmlTextReader xmlReader = new XmlTextReader(zip))
{
while (xmlReader.Read())
{
// hw没有period,暂时给一个默认值15
if (xmlReader.NodeType == XmlNodeType.Element && xmlReader.Name.ToLower() == "fileheader")
{
string reportTime = xmlReader.GetAttribute("reportTime").Replace("24:00:00", "23:59:59");
string startTime = xmlReader.GetAttribute("startTime").Replace("24:00:00", "23:59:59");
string endTime = xmlReader.GetAttribute("endTime").Replace("24:00:00", "23:59:59"); break;
}
}
}
}

最新文章

  1. java substring
  2. [学习笔记]四边形不等式优化DP
  3. MongoDB-JAVA-Driver 3.2版本常用代码全整理(2) - 查询
  4. React和ES6(二)ES6的类和ES7的property initializer
  5. Centos 6.5(64bit)上安装Vertica single node
  6. 二、IRIG_B解码AC信号
  7. IE下判断IE版本的语句...[if lte IE 6]……[endif]
  8. string和stringbuilder
  9. 进程识别号(PID)的理解
  10. Ecshop导航栏标题栏的伪静态设置
  11. beanutils设置参数和获取参数
  12. Mysql利用存储过程插入400W条数据
  13. 原生js简单调用百度翻译API实现的翻译工具
  14. mysql 开发基础系列14 字符集
  15. sql 索引笔记
  16. Centos6.8下编译安装LAMP的操作记录梳理
  17. 原生App切图的那些事儿
  18. 针对程序员的podcast
  19. C#图片处理,缩略图制作
  20. zTree静态树与动态树的用法——(七)

热门文章

  1. Hightcharts设置Y轴最大最小值
  2. IOS启动顺序
  3. 初识socket
  4. (转) 使用Speech SDK 5.1文字转音频
  5. SQLite datatype
  6. Curl参数一览
  7. android-数据存储之外部file存储(sdcard)
  8. Oracle中建表和指定表空间
  9. HTML5 表单属性
  10. windows自带的压缩,解压缩命令