Form1.cs

(开头部分) 1KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;

namespace ReadBinaryFile
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            openFileDialog1.Filter = "*.bin|*.bin";
            openFileDialog1.ShowDialog();
            textBox1.Text = openFileDialog1.FileName;
        }
        // 下载于www.51aspx.com 
        private void button2_Click(object sender, EventArgs e)
        {
            if (String.IsNullOrEmpty(textBox1.Text.Trim()))
            {
                MessageBox.Show("请选择文件");
                return;
            }

            textBox2.Text = string.Empty;
            try
            {
                FileStream myStream = new FileStream(textBox1.Text, FileMode.Open, FileAccess.Read);
                BinaryReader myReader = new BinaryReader(myStream);
                for (int i = 0; i < myStream.Length; i++)
                {
                    textBox2.Text += myReader.ReadInt32();
                }
                myReader.Close();
                myStream.Close();
            }
            catch { }
            //FileStream myStream = new FileStream(textBox1.Text, FileMode.Open, FileAccess.Write);
            //BinaryWriter myReader = new BinaryWriter(myStream);
            //string s = "Hello World";
            //byte[] bytes = new byte[s.Length];
            //for (int i = 0; i < bytes.Length; i++)
            //{
            //    bytes[i] = Convert.ToByte(s[i]);
            //}
            //myReader.Write(bytes);
            //myReader.Close();
            //myStream.Close();
        }
    }
后面还有 1 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。