Translation from 16-river system c#



  • The entrance (especially text boxes) is given a 16-page number with which certain mathematical actions are required. I suggest that the implementation should be transformed into a 10th system.
    The problem is:
    1. How do you put out a defense against a fool in a particular case?
    2. How do you turn the number into 10? It is possible, however, with the assistance of Parse, to convert the 16-page to a point?

    Well, as a conclusion, maybe I can see a question from the wrong angle and there are easier and more rational solutions?



  • Well, that's how you can be transferred to the 10th computation system.

    int x = Convert.ToInt32(textBox1.Text, 16);
    

    For the number with the point, you can try to translate into parts, first a whole part, then a fraction. And then write it down. double

    1 Option:

    As for protection against fools, it might be worth trying to get the text in textbox not immediately but to read the keyboards and check with the acceptable symbols, that is.

    Key[] ValidKeys = {Key.D1, Key.D2, ... , Key.Numpad1, Key.Numpad2, ... , Key.A, Key.B, ..., Key.F}
    

    And then the button was compressed with this mass. And then the symbol added to the line.

    Option 2:

    Create an event of clavicle compression that will compare the changed line with the original. And if the symbol for which it has changed does not fall within the range of valid, then assign the original line.


Log in to reply
 


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2