[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

[格式转换] Base64编码、解码工具Base64.exeV1.00

Base64 [options] [input file] [output file]
  options are:
  -i <filename> input file (default: stdin)
  -o <filename> output file (default: stdout)
  -e            encode binary to Base64 (default)
  -d            decode Base64 to binary
  -n <n>        encode n characters per line (0:no line breaks,default:64)
  -E <STRING>   encode and put -----BEGIN/END <STRING>----- around output
  --            indicate end of options
Call as b642bin to preselect decoding
(c) Matthias Gaertner 2002 - v1.00

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

本地下载:http://bcn.bathome.net/s/tool/index.html?key=Base64
我帮忙写的代码不需要付钱。如果一定要给,请在微信群或QQ群发给大家吧。
【微信公众号、微信群、QQ群】http://bbs.bathome.net/thread-3473-1-1.html
【支持批处理之家,加入VIP会员!】http://bbs.bathome.net/thread-67716-1-1.html

好东西
省的自己写了
哈哈

TOP

我从帖子下载了这一工具
使用过程发现字符转换时,Base64编码末尾总不正确
比如说:
字符串“Batcher”转换后应为“QmF0Y2hlcg==”而它是“QmF0Y2hlcg0K”
字符串“suntb”转换后应为“c3VudGI=”而它是“c3VudGINCg==

是否和我处理的命令方式有关?
我是先设置变量str
然后echo %str%|base64

[ 本帖最后由 SunTB 于 2009-10-9 22:41 编辑 ]

TOP

你在字符串末尾加了回车
  1. set/p=Batcher<nul|Base64.exe
复制代码
命令行参考:hh.exe ntcmds.chm::/ntcmds.htm
求助者请拿出诚心,别人才愿意奉献热心!
把查看手册形成条件反射!

TOP

原帖由 zqz0012005 于 2009-10-9 22:41 发表
你在字符串末尾加了回车set/p=Batcher


F:\批处理\软件>set/p=Batcher<nul|Base64.exe
QmF0Y2hlciA=

还是不对啊

TOP

倒是下面这个结果正确,但是得按两次回车(应该是用了两个set/p的缘故)才显示数据,郁闷

F:\批处理\软件>set/p=Batcher|Base64.exe
QmF0Y2hlcg==

代码贴上来老大们帮忙看看问题出在哪
  1. @echo off
  2. :begin
  3. cls
  4. set /p str=输入要转换的内容:
  5. set/p=%str%|base64
  6. pause>nul&goto :begin
复制代码

[ 本帖最后由 SunTB 于 2009-10-9 23:13 编辑 ]

TOP

顶楼这个工具主要用于对文件内容进行Base64编码,如果需要对字符串进行编码,推荐sum.exe
http://bbs.bathome.net/thread-3981-1-1.html
我帮忙写的代码不需要付钱。如果一定要给,请在微信群或QQ群发给大家吧。
【微信公众号、微信群、QQ群】http://bbs.bathome.net/thread-3473-1-1.html
【支持批处理之家,加入VIP会员!】http://bbs.bathome.net/thread-67716-1-1.html

TOP

set/p=Batcher<nul|Base64.exe 原来Batcher后面多了空格。
看来又和预处理有关,预处理时对语句进行标准格式化,变成了set/p=Batcher 0<nul  | Base64.exe

这里又提醒了大家,在管道符前后的命令中使用重定向符号时会引入额外的空格,以前注意到使用连接符&、&&、|| 时会产生空格,这都是预处理带来的问题。
  1. (set/p=Batcher|base64.exe)<nul
复制代码
  1. cmd/c"set/p=Batcher<nul"|base64.exe
复制代码
命令行参考:hh.exe ntcmds.chm::/ntcmds.htm
求助者请拿出诚心,别人才愿意奉献热心!
把查看手册形成条件反射!

TOP

使用说明翻译

Base64 [options] [input file] [output file]
  options are:
  -i <filename> input file (default: stdin)
  -o <filename> output file (default: stdout)
  -e            encode binary to Base64 (default)
  -d            decode Base64 to binary
  -n <n>        encode n characters per line (0:no line breaks,default:64)
  -E <STRING>   encode and put -----BEGIN/END <STRING>----- around output
  --            indicate end of options
Call as b642bin to preselect decoding
(c) Matthias Gaertner 2002 - v1.00

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
——————————————————————————————————————
Base64 [选项] [输入文件] [输出文件]         ——命令格式
  选项有:
  -i  <文件名>    输入文件(默认是:标准输入)
  -o <文件名>    输出文件(默认是:标准输出)
  -e      二进制Base64编码(默认)
  -d      解码为二进制的Base64
    -n <n>        每行(0:n个字符的编码不换行,默认值:64)
  -E <字符串>    编码,把-----BEGIN/END <字符串> -----各地输出
  -     表明选项结束    ——帮助说明
   传唤b642bin预选解码
(三)马蒂亚斯格特纳2002 - v1.00

本程序是,希望这将是有益的,但没有任何担保,甚至没有暗示的保证,适销性或针对特定用途的保证。见GNU通用公共许可证的更多细节。

TOP

感谢您的分享,论坛有你更精彩,谢谢!!!!

TOP

回复 1# Batcher

站长这个工具还有更新吗?

TOP

返回列表