Using System;
Using System.Collections.Generic;
Using System.ComponentModel;
Using System.Data;
Using System.Drawing;
Using System.Text;
Using System.Windows.Forms;
namespace Exdtob {public partial class Form1:form {public Form1 () {
InitializeComponent ();
//Decimal Turn two public string Dtob (int d) {string b = "";
To determine if the number is less than 2, direct output if (D < 2) {b = d.tostring ();
else {int C;
int s = 0;
int n = d;
while (n >= 2) {s++;
n = N/2;
} int[] m = new Int[s];
int i = 0; do {c = D/2;
m[i++] = d% 2;
D = C;
while (c >= 2);
b = d.tostring (); for (int j = m.length-1 J >=0; j--) {b + = M[j].
ToString ();
} return B;
}//Decimal octal---www.bianceng.cn public string dtoo (int d) {string o = "";
if (D < 8) {o = d.tostring ();
else {int C;
int s=0;
int N=d;
int temp = D;
while (n >= 8) {s++;
n = n/8;
} int[] m = new Int[s];
int i = 0;
do { c = D/8;
m[i++] = d% 8;
D = C;
while (c >= 8);
o = d.tostring ();
for (int j = m.length-1 J >= 0; j--) {o = = M[j];
} return o;
}//decimal hexadecimal public string Dtox (int d) {string x = "";
if (d <) {x = Chang (d);
else {int C;
int s = 0;
int n = d;
int temp = D;
while (n >=) {s++;
n = n/16;
} string [] m = new String[s];
int i = 0;
do { c = D/16;
m[i++] = Chang (d% 16),//judge whether is greater than 10, if greater than 10, then convert to a~f format d = c;
while (c >= 16);
x = Chang (d);
for (int j = m.length-1 J >= 0; j--) {x = = M[j];
} return x; //Determine if the number is between 10~15 and if yes convert public string chang (int d) {string x =
"";
Switch (d) {case 10:x = "A";
Break
Case 11:x = "B";
Break
Case 12:x = "C";
Break
Case 13:x = "D";
Break
Case 14:x = "E"; Break
Case 15:x = "F";
Break
default:x = D.tostring ();
Break
return x; } private void Button1_Click (object sender, EventArgs e) {TextBox2.Text = Dtob (Co Nvert.
ToInt32 (TextBox1.Text));//10 conversion binary} private void Button2_Click (object sender, EventArgs e) {TextBox2.Text = Dtoo (Convert.ToInt32 (TextBox1.Text));//10 ext octal} private void B Utton3_click (object sender, EventArgs e) {TextBox2.Text = Dtox (Convert.ToInt32 (TextBox1.Text)); Decimal Hexadecimal}}}