ITPub博客

首页 > IT职业 > IT生活 > 将数据流转换为二进制字符串

将数据流转换为二进制字符串

IT生活 作者:keehoo 时间:2021-09-09 09:12:30 0 删除 编辑

实例演示。

xxx.aspx代码:

View Code
                    Text="输出二进制" onclick="Button1_Click" />

        

 

xxx.aspx.cs:

View Code using System;
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/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2019-08-12

  • 博文量
    0
  • 访问量
    632