标题:Get后put多个空格是为什么?
只看楼主
沉默的痞子
Rank: 4
等 级:贵宾
威 望:12
帖 子:96
专家分:127
注 册:2015-10-7
结帖率:45%
 问题点数:0 回复次数:1 
Get后put多个空格是为什么?
程序代码:
Dim ar() As Byte
Open "C:\Users\bocheng\Desktop\1.txt" For Binary As #1
ReDim ar(1 To LOF(1)) As Byte
    Get #1, , ar
Close #1
Open "C:\Users\bocheng\Desktop\2.txt" For Binary As #1
    Put #1, , ar
Close #1


2.txt比1.txt后面多个空格

程序代码:
Dim ar() As Byte
Open "C:\Users\bocheng\Desktop\1.txt" For Binary As #1
ReDim ar(1 To LOF(1)) As Byte
    Get #1, , ar
Close #1
Open "C:\Users\bocheng\Desktop\2.txt" For Binary As #1
    Put #1, , ar
Close #1

Open "C:\Users\bocheng\Desktop\2.txt" For Binary As #1
    Get #1, , ar
Close #1
Open "C:\Users\bocheng\Desktop\3.txt" For Binary As #1
    Put #1, , ar
Close #1
End


2.txt还是多个空格,3.txt就正常,谁来解释下?
搜索更多相关主题的帖子: Desktop txt For Binary Close 
2018-11-22 08:39
风吹过b
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:贵宾
威 望:364
帖 子:4912
专家分:29900
注 册:2008-10-15
得分:0 
我改在E盘操作,测试代码生成的结果没问题。

E:\>fc 1.txt 2.txt  /b
正在比较文件 1.txt 和 2.TXT
FC: 找不到差异

E:\>fc 3.txt 2.txt /b
正在比较文件 3.txt 和 2.TXT
FC: 找不到差异

所以搞不懂你的问题出在哪里了。
文件内包含中文也是如此。

授人于鱼,不如授人于渔
早已停用QQ了
2018-11-22 11:30



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-491455-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.017467 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved