首页 > IT职业 > IT生活 > 将数据流转换为二进制字符串
实例演示。
xxx.aspx代码:

Text="输出二进制" onclick="Button1_Click" />
xxx.aspx.cs:

using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Insus.NET;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
//实例化数据流转二进制Utility类别
InsusBinaryUtility objInsusBinaryUtility = new InsusBinaryUtility();
this.txtbinary.Text = objInsusBinaryUtility.StreamToBinary(this.FileUpload1.PostedFile.InputStream);
}
}
执行结果:

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/4357/viewspace-2800581/ ,如需转载,请注明出处,否则将追究法律责任。