zoukankan      html  css  js  c++  java
  • 如何把数据流转换为二进制字符串

    你可以先下载一个小工具,http://www.cnblogs.com/insus/articles/1999497.html

    实例演示。

    xxx.aspx代码:

    View Code
    <asp:FileUpload ID="FileUpload1" runat="server" Width="300" />
            
    <asp:Button ID="Button1" runat="server"
                Text
    ="输出二进制" onclick="Button1_Click" /><br />
            
    <asp:TextBox ID="txtbinary" runat="server" TextMode="MultiLine" Width="600" Height="500"></asp:TextBox>

    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);
        }
    }

    执行结果:

  • 相关阅读:
    导航控制器的出栈
    UIPickView的基本使用
    多控制器
    通过Xib加载控制器的View
    从StoryBoard加载控制器
    模仿UIApplication单例
    LaunchScreen原理
    UIWindow
    指定初始化的运用
    零长度数组在内核中的运用
  • 原文地址:https://www.cnblogs.com/insus/p/1999519.html
Copyright © 2011-2022 走看看