二进制到ASCII? [英] Binary To ASCII?

查看:95
本文介绍了二进制到ASCII?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨。


我想知道ASCII模式下文件的大小(在FTP之前)。

原因是我想要知道文件的位数

一旦它到达FTP服务器并且在二进制和ascii模式之间存在大小差异

(100左右的字节)。


那么,如何使用

常用VB.NET API在ASCII模式下获取文件的大小?


我谢谢你。

Hi.

I want to know the size of a file (prior to FTP) in ASCII Mode.
The reason is that I want to know how bit the file is going to
be once it reaches the FTP server and there is a size difference
between binary and ascii mode (100 or so bytes).

So, how do I get the size of the file in ASCII Mode using the
usual VB.NET API?

I Thank You.

推荐答案

pbd22,


你确定吗该文件处于ASCII模式。这只是在CPM之前的计算机上的7位,可能只是
。目前使用的是Unicode,即

大多数情况下每个字符2个字节。


Cor

" pbd22" < du ***** @ gmail.comschreepbf in bericht

news:11 ********************** @ c51g2000cwc。 googlegr oups.com ...
pbd22,

Are you sure that the file is in ASCII mode. That is 7 bits that is probably
only on computers from pre CPM. At the moment is Unicode used, that is in
most situations 2 bytes per character.

Cor
"pbd22" <du*****@gmail.comschreepbf in bericht
news:11**********************@c51g2000cwc.googlegr oups.com...

嗨。


我想知道文件的大小(在FTP之前) )在ASCII模式下。

原因是我想知道文件到达FTP服务器后的位数是多少,并且存在大小差异
二进制和ascii模式之间的
(大约100个字节)。


那么,如何使用

通常的VB.NET API?


我谢谢你。
Hi.

I want to know the size of a file (prior to FTP) in ASCII Mode.
The reason is that I want to know how bit the file is going to
be once it reaches the FTP server and there is a size difference
between binary and ascii mode (100 or so bytes).

So, how do I get the size of the file in ASCII Mode using the
usual VB.NET API?

I Thank You.



如果有人发布关于

Unicode的奇怪解释,我会警告不要听。一个简单的测试写作你好在记事本中很容易证明文件中有5个字节,并且这就是pre CP / M的情况。与CP / M,CP / M-86,所有版本的DOS和所有版本的Windows

通过XP一样好。如果在Vista中不是这样的话我会感到惊讶。


现在......文件的文件是什么?我会感到惊讶的是,传输的任何文件大小都会增加一些固定的字节数。我认为你可能会看到的是一个Windows O / S的工件。


例如,我有一个468字节的文本文件,但它在一个

Windows目录中显示1KB。如果您查看该

文件的属性,它会显示468个字节,但是如果您发出命令提示符并显示DIR

命令它会报告468个字节。由于驱动器簇大小,该文件占用4K的磁盘空间但是



检查FileInfo类和Length属性,它报告什么?


Tom


" pbd22" < du ***** @ gmail.com写信息

news:11 ********************** @ c51g2000cwc。 googlegr oups.com ...
I''ll caution to not listen if anybody posts some odd explanation about
Unicode. A simple test writing "hello" in Notepad will easily prove that
there are 5 bytes in the file and that this has been the case "pre CP/M" as
well as in CP/M, CP/M-86, all versions of DOS and all versions of Windows
through XP. I''d be surprised if this isn''t the case in Vista.

Now... what is the file a file of? I''d be surprised that any file
transmitted increases in size by some fixed number of bytes. I think what
you might be seeing is an artifact of the Windows O/S.

For instance, I have a text file with 468 bytes but it displays 1KB in a
Windows directory. It displays 468 bytes if you view the properties of that
file but it displays if you shell out to a command prompt and issue the DIR
command it reports 468 bytes. The file takes up 4K of disk space however
due to the drive cluster size.

Check the FileInfo class and the Length property, what does it report?

Tom

"pbd22" <du*****@gmail.comwrote in message
news:11**********************@c51g2000cwc.googlegr oups.com...

嗨。


我想知道文件的大小(在FTP之前) )在ASCII模式下。

原因是我想知道文件到达FTP服务器后的位数是多少,并且存在大小差异
二进制和ascii模式之间的
(大约100个字节)。


那么,如何使用

通常的VB.NET API?


我谢谢你。
Hi.

I want to know the size of a file (prior to FTP) in ASCII Mode.
The reason is that I want to know how bit the file is going to
be once it reaches the FTP server and there is a size difference
between binary and ascii mode (100 or so bytes).

So, how do I get the size of the file in ASCII Mode using the
usual VB.NET API?

I Thank You.



pbd22写道:
pbd22 wrote:

嗨。


我想知道ASCII模式下文件的大小(在FTP之前) 。

原因是我想知道文件到底有多少

一旦它到达FTP服务器并且有一个大小差异
$二进制和ascii模式之间的b $ b(100左右)字节)。


那么,如何使用

常用VB.NET API在ASCII模式下获取文件的大小?


我谢谢你。
Hi.

I want to know the size of a file (prior to FTP) in ASCII Mode.
The reason is that I want to know how bit the file is going to
be once it reaches the FTP server and there is a size difference
between binary and ascii mode (100 or so bytes).

So, how do I get the size of the file in ASCII Mode using the
usual VB.NET API?

I Thank You.



如果大小随ASCII模式转移而改变,那么它很可能是

由于换行符的转换。


unix系统使用\ n作为换行符,而windows系统使用\\\\ n。

ascii模式传输应该在不同样式的

换行符之间进行转换,以适应存储文件的系统。


找出什么一个文件的大小将在转换后,你有

来知道源和目标系统使用什么样的换行符

知道是否会有任何转换所有,你必须检查文件中的

数据,看看它包含多少个换行符。


-

G?ran Andersson

_____
http://www.guffa.com


这篇关于二进制到ASCII?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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