使用C#从GZ文件读取内容 [英] Reading content from gz file using c#

查看:261
本文介绍了使用C#从GZ文件读取内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想读取.gz格式的压缩数据.它包含一个扩展名为.log的日志文件.

任何人都可以说出如何使用c#.i来实现此步骤.我想逐行读取gz文件中的数据而不提取文件?

在此先感谢

谢谢与问候
Santhosh

Hi,

i want to read data which is in zipped in .gz format. it contains one log file with .log extension.

anyone can tell how to achieve this step using c#.i want to read the data line by line which is in gz file without extracting the file?

Thanks in advance

Thanks & Regards
Santhosh

推荐答案

这可能会有所帮助:
http://www.icsharpcode.net/opensource/sharpziplib/ [ google 查找实例. > [ ^ ]

您也可以浏览 System.IO.Compression.GZipStream [^ ]

问候
Espen Harlinn
This may help:
http://www.icsharpcode.net/opensource/sharpziplib/[^]

You''ll find exaples using google[^]

You can also take a loog at System.IO.Compression.GZipStream[^]

Regards
Espen Harlinn


AFAIK,您不能:.gz文件不是逐行"存储的,必须完整提取文件才能使用它们,至少到一个临时文件/目录.

请参见 MSDN GZipStream类 [
AFAIK you can''t: .gz files aren''t stored "line-by-line" and the files have to be extracted in their entirety before you can use them, at least to a temporary file / directory.

See MSDN GZipStream class[^] for further info.


这篇关于使用C#从GZ文件读取内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆