<legend id='1sgME'><style id='1sgME'><dir id='1sgME'><q id='1sgME'></q></dir></style></legend>

<small id='1sgME'></small><noframes id='1sgME'>

      <bdo id='1sgME'></bdo><ul id='1sgME'></ul>

      1. <i id='1sgME'><tr id='1sgME'><dt id='1sgME'><q id='1sgME'><span id='1sgME'><b id='1sgME'><form id='1sgME'><ins id='1sgME'></ins><ul id='1sgME'></ul><sub id='1sgME'></sub></form><legend id='1sgME'></legend><bdo id='1sgME'><pre id='1sgME'><center id='1sgME'></center></pre></bdo></b><th id='1sgME'></th></span></q></dt></tr></i><div id='1sgME'><tfoot id='1sgME'></tfoot><dl id='1sgME'><fieldset id='1sgME'></fieldset></dl></div>
      2. <tfoot id='1sgME'></tfoot>

        如何确定文件是c#中的二进制文件还是文本文件

        时间:2023-06-03
      3. <small id='1VO1E'></small><noframes id='1VO1E'>

          <tbody id='1VO1E'></tbody>
            <i id='1VO1E'><tr id='1VO1E'><dt id='1VO1E'><q id='1VO1E'><span id='1VO1E'><b id='1VO1E'><form id='1VO1E'><ins id='1VO1E'></ins><ul id='1VO1E'></ul><sub id='1VO1E'></sub></form><legend id='1VO1E'></legend><bdo id='1VO1E'><pre id='1VO1E'><center id='1VO1E'></center></pre></bdo></b><th id='1VO1E'></th></span></q></dt></tr></i><div id='1VO1E'><tfoot id='1VO1E'></tfoot><dl id='1VO1E'><fieldset id='1VO1E'></fieldset></dl></div>
            <tfoot id='1VO1E'></tfoot>
              <bdo id='1VO1E'></bdo><ul id='1VO1E'></ul>

                  <legend id='1VO1E'><style id='1VO1E'><dir id='1VO1E'><q id='1VO1E'></q></dir></style></legend>
                  本文介绍了如何确定文件是c#中的二进制文件还是文本文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我需要确定 80% 的文件是二进制文件还是文本文件,有没有什么方法可以在 c# 中快速和肮脏/丑陋?

                  I need to determine in 80% if a file is binary or text, is there any way to do it even quick and dirty/ugly in c#?

                  推荐答案

                  我可能会寻找大量的控制字符,这些字符通常出现在二进制文件中,但很少出现在文本文件中.二进制文件倾向于使用足够的 0,以至于仅测试许多 0 字节可能足以捕获大多数文件.如果您关心本地化,您还需要测试多字节模式.

                  I would probably look for an abundance of control characters which would typically be present in a binary file but rarely in an text file. Binary files tend to use 0 enough that just testing for many 0 bytes would probably be sufficient to catch most files. If you care about localization you'd need to test multi-byte patterns as well.

                  如前所述,您总是很不幸,得到一个看起来像文本的二进制文件,反之亦然.

                  As stated though, you can always be unlucky and get a binary file that looks like text or vice versa.

                  这篇关于如何确定文件是c#中的二进制文件还是文本文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:使用 Entity Framework 6 从 SQL Server 保存和检索图像 下一篇:将二进制字符串转换为整数

                  相关文章

                  最新文章

                    <bdo id='RRSlC'></bdo><ul id='RRSlC'></ul>
                  1. <tfoot id='RRSlC'></tfoot>
                  2. <i id='RRSlC'><tr id='RRSlC'><dt id='RRSlC'><q id='RRSlC'><span id='RRSlC'><b id='RRSlC'><form id='RRSlC'><ins id='RRSlC'></ins><ul id='RRSlC'></ul><sub id='RRSlC'></sub></form><legend id='RRSlC'></legend><bdo id='RRSlC'><pre id='RRSlC'><center id='RRSlC'></center></pre></bdo></b><th id='RRSlC'></th></span></q></dt></tr></i><div id='RRSlC'><tfoot id='RRSlC'></tfoot><dl id='RRSlC'><fieldset id='RRSlC'></fieldset></dl></div>

                    <small id='RRSlC'></small><noframes id='RRSlC'>

                    <legend id='RRSlC'><style id='RRSlC'><dir id='RRSlC'><q id='RRSlC'></q></dir></style></legend>