// Store integer 182
int decValue = 182;
// Convert integer 182 as a hex in a string variable
string hexValue = decValue.ToString("X");
// Convert the hex string back to the number
int decAgain = int.Parse(hexValue, System.Globalization.NumberStyles.HexNumber);
ToString()에서 X 키워드를 넣으면 Hex값으로 변환이 되죠.
그 반대로 Hex문자열을 int로 변환하려면 위와 같은 작업을 해줘야 하는군요..
혹시 기억 안나실땐 위 코드를..
'.NET > C#' 카테고리의 다른 글
| 파일 사이즈 변환 (0) | 2008/04/02 |
|---|---|
| C# XML Document 생성 애드인(Add-in) (1) | 2007/12/19 |
| C#에서 Hex 값을 Int로 또는 그 반대로 (0) | 2007/12/18 |
| WPF 3D 온라인 강좌 (0) | 2007/12/04 |
| .NET 통합 언어 쿼리 LINQ (0) | 2007/11/26 |
| COM+ : Recovery thread failed to start 에러 해결방법 (0) | 2007/11/12 |
이 포스팅이 도움이 되었다면 구글에서 관련 정보를 찾아 보세요 ^^

Prev



