2017-01-09 6 views

답변

2

단일체 :

[Convert]::ToInt32($encoded[0], 16); 

( ToInt16도 사용할 수 있지만, 실제로 INT32을위한 속기 내장 지능 타입입니다)

+0

아름다운. 이것은 비트 시프 팅과 함께 작동합니다. 고맙습니다. – AlwaysQuestioning

-1

살펴

를하시기 바랍니다
function asciiToHex($a) 
{ 
$b = $a.ToCharArray(); 
Foreach ($element in $b) {$c = $c + "%#x" + [System.String]::Format("{0:X}", 
[System.Convert]::ToUInt32($element)) + ";"} 
$c 
} 

http://learningpcs.blogspot.in/2009/07/powershell-string-to-hex-or-whatever.html

+1

이것은 묻는 사람이하려는 일을하는 것처럼 보이지 않으며 코드를 전혀 설명하지 않아서 이해하지 못하는 사람에게 명확하지 않을 수 있습니다. – briantist