16进制累加器

在这里插入图片描述

具体代码
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;

namespace _16进制累加
{
	// Token: 0x02000002 RID: 2
	public class Form1 : Form
	{
		// Token: 0x06000001 RID: 1 RVA: 0x00002050 File Offset: 0x00000250
		public Form1()
		{
			this.InitializeComponent();
		}

		// Token: 0x06000002 RID: 2 RVA: 0x00002068 File Offset: 0x00000268
		private void Form1_Load(object sender, EventArgs e)
		{
		}

		// Token: 0x06000003 RID: 3 RVA: 0x0000206C File Offset: 0x0000026C
		private void chaifen(string str)
		{
			try
			{
				string[] array = str.Split(new char[]
				{
					' '
				});
				int num = 0;
				int num2 = 0;
				while (!array[num2].Equals("#"))
				{
					num += Convert.ToInt32(array[num2], 16);
					num2++;
				}
				this.richTextBox2.Text = Convert.ToString(num, 16);
				bool flag = !this.radioButton1.Checked;
				if (flag)
				{
					int num3 = int.Parse(this.textBox1.Text);
					this.richTextBox2.Text = "运算结果:" + this.richTextBox2.Text.Substring(this.richTextBox2.Text.Length - num3);
				}
				else
				{
					this.richTextBox2.Text = "运算结果:" + this.richTextBox2.Text;
				}
			}
			catch
			{
				MessageBox.Show("您输入的字符串格式错误", "格式错误");
			}
		}

		// Token: 0x06000004 RID: 4 RVA: 0x00002180 File Offset: 0x00000380
		private void button1_Click(object sender, EventArgs e)
		{
			this.chaifen(this.richTextBox1.Text + " #");
		}

		// Token: 0x06000005 RID: 5 RVA: 0x0000219F File Offset: 0x0000039F
		private void richTextBox2_TextChanged(object sender, EventArgs e)
		{
		}

		// Token: 0x06000006 RID: 6 RVA: 0x000021A2 File Offset: 0x000003A2
		private void radioButton1_CheckedChanged(object sender, EventArgs e)
		{
			this.textBox1.ReadOnly = true;
		}

		// Token: 0x06000007 RID: 7 RVA: 0x000021B2 File Offset: 0x000003B2
		private void radioButton2_CheckedChanged(object sender, EventArgs e)
		{
			this.textBox1.ReadOnly = false;
		}

		// Token: 0x06000008 RID: 8 RVA: 0x000021C2 File Offset: 0x000003C2
		private void 关于ToolStripMenuItem_Click(object sender, EventArgs e)
		{
			MessageBox.Show("作者:小杉杉\nQQ:764854759", "作者信息");
		}

		// Token: 0x06000009 RID: 9 RVA: 0x000021D8 File Offset: 0x000003D8
		protected override void Dispose(bool disposing)
		{
			bool flag = disposing && this.components != null;
			if (flag)
			{
				this.components.Dispose();
			}
			base.Dispose(disposing);
		}

		// Token: 0x0600000A RID: 10 RVA: 0x00002210 File Offset: 0x00000410
		private void InitializeComponent()
		{
			ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof(Form1));
			this.button1 = new Button();
			this.richTextBox1 = new RichTextBox();
			this.richTextBox2 = new RichTextBox();
			this.radioButton1 = new RadioButton();
			this.radioButton2 = new RadioButton();
			this.textBox1 = new TextBox();
			this.menuStrip1 = new MenuStrip();
			this.程序ToolStripMenuItem = new ToolStripMenuItem();
			this.关于ToolStripMenuItem = new ToolStripMenuItem();
			this.menuStrip1.SuspendLayout();
			base.SuspendLayout();
			this.button1.Font = new Font("宋体", 15f);
			this.button1.Location = new Point(411, 358);
			this.button1.Name = "button1";
			this.button1.Size = new Size(104, 80);
			this.button1.TabIndex = 0;
			this.button1.Text = "运算";
			this.button1.UseVisualStyleBackColor = true;
			this.button1.Click += this.button1_Click;
			this.richTextBox1.Location = new Point(12, 30);
			this.richTextBox1.Name = "richTextBox1";
			this.richTextBox1.Size = new Size(503, 300);
			this.richTextBox1.TabIndex = 1;
			this.richTextBox1.Text = "";
			this.richTextBox2.Location = new Point(12, 358);
			this.richTextBox2.Name = "richTextBox2";
			this.richTextBox2.ReadOnly = true;
			this.richTextBox2.Size = new Size(393, 80);
			this.richTextBox2.TabIndex = 2;
			this.richTextBox2.Text = "";
			this.richTextBox2.TextChanged += this.richTextBox2_TextChanged;
			this.radioButton1.AutoSize = true;
			this.radioButton1.Checked = true;
			this.radioButton1.Location = new Point(12, 336);
			this.radioButton1.Name = "radioButton1";
			this.radioButton1.Size = new Size(71, 16);
			this.radioButton1.TabIndex = 3;
			this.radioButton1.TabStop = true;
			this.radioButton1.Text = "全局截取";
			this.radioButton1.UseVisualStyleBackColor = true;
			this.radioButton1.CheckedChanged += this.radioButton1_CheckedChanged;
			this.radioButton2.AutoSize = true;
			this.radioButton2.Location = new Point(113, 336);
			this.radioButton2.Name = "radioButton2";
			this.radioButton2.Size = new Size(83, 16);
			this.radioButton2.TabIndex = 4;
			this.radioButton2.Text = "截取后几位";
			this.radioButton2.UseVisualStyleBackColor = true;
			this.radioButton2.CheckedChanged += this.radioButton2_CheckedChanged;
			this.textBox1.Location = new Point(200, 334);
			this.textBox1.Name = "textBox1";
			this.textBox1.ReadOnly = true;
			this.textBox1.Size = new Size(60, 21);
			this.textBox1.TabIndex = 5;
			this.textBox1.TextAlign = HorizontalAlignment.Center;
			this.menuStrip1.Items.AddRange(new ToolStripItem[]
			{
				this.程序ToolStripMenuItem
			});
			this.menuStrip1.Location = new Point(0, 0);
			this.menuStrip1.Name = "menuStrip1";
			this.menuStrip1.Size = new Size(527, 25);
			this.menuStrip1.TabIndex = 6;
			this.menuStrip1.Text = "menuStrip1";
			this.程序ToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[]
			{
				this.关于ToolStripMenuItem
			});
			this.程序ToolStripMenuItem.Name = "程序ToolStripMenuItem";
			this.程序ToolStripMenuItem.Size = new Size(44, 21);
			this.程序ToolStripMenuItem.Text = "程序";
			this.关于ToolStripMenuItem.Name = "关于ToolStripMenuItem";
			this.关于ToolStripMenuItem.Size = new Size(180, 22);
			this.关于ToolStripMenuItem.Text = "关于";
			this.关于ToolStripMenuItem.Click += this.关于ToolStripMenuItem_Click;
			base.AutoScaleDimensions = new SizeF(6f, 12f);
			base.AutoScaleMode = AutoScaleMode.Font;
			base.ClientSize = new Size(527, 450);
			base.Controls.Add(this.textBox1);
			base.Controls.Add(this.radioButton2);
			base.Controls.Add(this.radioButton1);
			base.Controls.Add(this.richTextBox2);
			base.Controls.Add(this.richTextBox1);
			base.Controls.Add(this.button1);
			base.Controls.Add(this.menuStrip1);
			base.Icon = (Icon)componentResourceManager.GetObject("$this.Icon");
			base.MainMenuStrip = this.menuStrip1;
			base.Name = "Form1";
			base.StartPosition = FormStartPosition.CenterScreen;
			this.Text = "十六进制累加器";
			base.Load += this.Form1_Load;
			this.menuStrip1.ResumeLayout(false);
			this.menuStrip1.PerformLayout();
			base.ResumeLayout(false);
			base.PerformLayout();
		}

		// Token: 0x04000001 RID: 1
		private IContainer components = null;

		// Token: 0x04000002 RID: 2
		private Button button1;

		// Token: 0x04000003 RID: 3
		private RichTextBox richTextBox1;

		// Token: 0x04000004 RID: 4
		private RichTextBox richTextBox2;

		// Token: 0x04000005 RID: 5
		private RadioButton radioButton1;

		// Token: 0x04000006 RID: 6
		private RadioButton radioButton2;

		// Token: 0x04000007 RID: 7
		private TextBox textBox1;

		// Token: 0x04000008 RID: 8
		private MenuStrip menuStrip1;

		// Token: 0x04000009 RID: 9
		private ToolStripMenuItem 程序ToolStripMenuItem;

		// Token: 0x0400000A RID: 10
		private ToolStripMenuItem 关于ToolStripMenuItem;
	}
}

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

️公子

有帮助的,请多支持我哦

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值