Town Field Poem:
——— Dream who feel, the water month Build blog. Baiqian tribulation, only know the vicissitudes of the world.
——— today holds the Buddhist language, the technology is boundless willing to learn. Willing to do what you learn, cast a conscience blog.
——————————————————————————————————————————
1 UI
2 Code
1 using System;
2 using System.Collections.Generic;
3 using System.ComponentModel;
4 using System.Data;
5 using System.Drawing;
6 using System.Linq;
7 using System.Text;
8 using System.Threading.Tasks;
9 using System.Windows.Forms;
10
11 namespace WindowsFormsApplication5
12 {
13 public partial class Form1 : Form
14 {
15 public Form1()
16 {
17 InitializeComponent();
18 }
19
20 /// <summary>
21 /// Convert between hexadecimal, defective, can not be converted between signed hexadecimal
22 /// </summary>
23 /// <param name="input">processed data</param>
24 /// <param name="typeOfInput">What is the input data </param>
25 /// <param name="typeOfOutput">What is the output data?</param>
26 /// <returns>returns the converted data</returns>
27 public string ConvertNumber(string input, int typeOfInput, int typeOfOutput)
28 {
29 int value = Convert.ToInt32(input, typeOfInput);
30 string res = Convert.ToString(value, typeOfOutput);
31
32 return res;
33 }
34
35
36 private void btn8_16_Click(object sender, EventArgs e)
37 {
38 textBoxOfOutput.Text = ConvertNumber(textBoxOfInput.Text, 8, 16);
39 }
40 }
41 }
3 Show
In order to verify the correctness of the program, I took steps to convert the octal binary into binary, it is easy to see whether the hexadecimal conversion is correct by binary binary.
——————————————————————————————————————————
The essence of the blog, in the technical part, more in the town yard a poem.
C # is a good language, worth studying hard.
If the content of the post can be improved, or even the wrong place, please leave a comment, I will try to correct, strive to cast a conscience blog.
Note: This article is only as a scientific research study, if I inadvertently violated your rights and interests, please be sure to timely inform, I will make corrections.
C#winform base octal conversion to 16 binary (unsigned, integer)