개발관련/C#
c# hex to binary 함수
후니의 개발이야기
2010. 3. 18. 13:08
728x90
반응형
|
|
한동안 블로그에 글을 쓰는것을 좀 등안시 했네요
계속된 해외출장으로 개발보다는 여행사진위주로 글을 올렸네요
오랜만에 Hexa code를 binary로 바꿔주는 함수를 올립니다.
저도 구글링을 통해 얻은 것이라 ㅋ
private string hex2binary(string hexvalue)
{ //hex값을 binary로 변화해 주는 함수
string binaryval = "";
binaryval = Convert.ToString(Convert.ToInt32(hexvalue, 16), 2);
return binaryval;
}
이 함수를 쓰시면 binary로 변환을 해주네요
출처 : http://alperguc.blogspot.com/2008/11/c-convert-hexadecimal-to-binary-string.html
위의 블로그에 C# 관련된 유용한 것이 많이 있더군요
참고하세요
|
|
728x90