View Full Version : سوال: تبدیل Hex به String
  
fsima
شنبه 17 دی 1390, 22:05 عصر
چه طور می تونم هگز را به استرینگ تبدیل کرد کسی کدش را داره ؟
mostafa69d
یک شنبه 18 دی 1390, 00:02 صبح
//convert string to HexaDecimal
            string strNumber = "456";
            int number = int.Parse(strNumber);
            string result = number.ToString("x");
            MessageBox.Show(result);
            //OutPut Is 1c8
            //convert HexaDecimal to string
            string strHex = "1c8";
            int number2 = int.Parse(strHex, System.Globalization.NumberStyles.HexNumber);
            string result2 = number2.ToString();
            MessageBox.Show(result2);
            //Output Is 456
MohammadGh2011
یک شنبه 18 دی 1390, 00:08 صبح
//convert string to HexaDecimal
            string strNumber = "456";
            int number = int.Parse(strNumber);
            string result = number.ToString("x");
            MessageBox.Show(result);
            //OutPut Is 1c8
            //convert HexaDecimal to string
            string strHex = "1c8";
            int number2 = int.Parse(strHex, System.Globalization.NumberStyles.HexNumber);
            string result2 = number2.ToString();
            MessageBox.Show(result2);
            //Output Is 456
 
سلام عليکم
کدها به زبان سي شارپ ميباشد.اين تالار مخصوص ويژوال بيسيک 6 ميباشد.
 
vBulletin® v4.2.5, Copyright ©2000-1404, Jelsoft Enterprises Ltd.