我可以把二进制的标准输入? C# [英] Can i put binary in stdin? C#

查看:110
本文介绍了我可以把二进制的标准输入? C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

与此相关的问题,<一个href="http://stackoverflow.com/questions/1284088/encrypt-binary-with-7z-without-filenames/1284101#1284101">http://stackoverflow.com/questions/1284088/encrypt-binary-with-7z-without-filenames/1284101#1284101

在C#中我如何可以把二进制的标准输入?我希望下面会工作,但它没有。它是有道理的。那么,如何推动一个byte []数组?

 新的BinaryWriter(p.StandardInput.FormatProvider);
 

解决方案

直接写入基本流:

 
新的BinaryWriter(p.StandardInput.BaseStream)
 

Related to this question http://stackoverflow.com/questions/1284088/encrypt-binary-with-7z-without-filenames/1284101#1284101

In C# how can i put binary in STDin? i was hoping the below would work but it doesnt. And it makes sense. So how do i push a byte[] array?

new BinaryWriter(p.StandardInput.FormatProvider);

解决方案

Write directly to the base stream:


new BinaryWriter(p.StandardInput.BaseStream)

这篇关于我可以把二进制的标准输入? C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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