2-36 decimal, hexadecimal system conversion can be any class

using System; using System.Collections.Generic; using System.Linq; using System.Text;

 

namespace AnyConvertx2x {/// <summary> /// digital binary conversion type /// </ summary> public class AnyConvert {private static char [] rDigits = { '0', '1', '2', '3 ',' 4 ',' 5 ',' 6 ',' 7 ',' 8 ',' 9 ',' A ',' B ',' C ',' D ',' E ',' F ', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S ',' T ',' U ',' V ',' W ',' X ',' Y ',' Z '}; /// <summary> /// number in a specified base represented System.String It is converted to the form of 64-bit signed integer equivalent. /// </ summary> /// <param name = "value"> contain numbers System.String. </ Param> /// <param name = "fromBase"> the digital base value, it must be [2,36] </ param>

 

 

 

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 AnyConvertx2x; namespace AnyRadixConvert { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { AnyConvert convert = new AnyConvert(); textBox2 .Text = convert.X2X(textBox1 .Text , 36, 10);//36 To 10 } private void button2_Click(object sender, EventArgs e) { AnyConvert convert = new AnyConvert(); textBox2.Text = convert.X2X(textBox1.Text, 10, 36);//10 To 36 } } }

Reproduced in: https: //www.cnblogs.com/simpleBlue3/p/3911606.html

Guess you like

Origin blog.csdn.net/weixin_34168700/article/details/93307516