ITPub博客

首页 > Linux操作系统 > Linux操作系统 > SAP ECC6 SOLUTION MANAGER KEY 生成脚本 (VBS)

SAP ECC6 SOLUTION MANAGER KEY 生成脚本 (VBS)

原创 Linux操作系统 作者:FishPerfect 时间:2011-09-18 23:13:40 0 删除 编辑
'''''''''''''''''''''''''''''''''''''' 
'   Solution Manager Key 生成器    ' 
'复制本文档,存为 SolManKeyGen.vbs        ' 
' 执行                                 ' 
'''''''''''''''''''''''''''''''''''''' 
'------------------------------------------------------- 
Dim SIDs, SNs, SERVs, msg, ENDs, KEYs 
msg="系统标识 (3位)" 
SIDs=InputBox(msg,"Solution Manager Key 生成器") 
msg="系统编号 (2位)" 
SNs=InputBox(msg,"Solution Manager Key 生成器") 
msg="主机名(最多15位)" 
SERVs=InputBox(msg,"Solution Manager Key 生成器") 
KEYs=SolManKeyGen(SIDs, SNs, SERVs) 
msg="Solution Manager Key" 
ENDs=InputBox(msg,"Solution Manager Key 生成器",KEYs) 
'------------------------------------------------------- 
Function SolManKeyGen(SIDst, SNst, SERVst) 
 Dim SIDSNhex(5) 
 Dim SERVhex(15) 
 Dim reshex(5) 
 SIDSNstr = UCase(SIDst) + UCase(SNst) 
 SERVstr  = UCase(SERVst) 
 For arrcnt = 1 To 5 
  SIDSNhex(arrcnt) = Asc(Mid(SIDSNstr, arrcnt, 1)) 
 Next 
 For arrcnt = 1 To Len(SERVstr) 
  SERVhex(arrcnt) = Asc(Mid(SERVstr, arrcnt, 1)) 
 Next 
 For arrcnt = Len(SERVstr) + 1 To 15 
  SERVhex(arrcnt) = 0 
 Next 
 If (Len(SERVstr) > 0) Then 
  If (Len(SERVstr) < 5) Then 
   For arrcnt = Len(SERVstr) + 1 To 5 
    SERVhex(arrcnt) = Asc(" ") 
   Next 
  End If 
 End If 
 If (Len(SERVstr) > 5) Then 
  If (Len(SERVstr) < 10) Then 
   For arrcnt = Len(SERVstr) + 1 To 10 
    SERVhex(arrcnt) = Asc(" ") 
   Next 
  End If 
 End If 
 If (Len(SERVstr) > 10) Then 
  If (Len(SERVstr) < 15) Then 
   For arrcnt = Len(SERVstr) + 1 To 15 
    SERVhex(arrcnt) = Asc(" ") 
   Next 
  End If 
 End If 
 For arrcnt = 1 To 5 
  reshex(arrcnt) = ((((0 Xor SIDSNhex(arrcnt)) Xor SERVhex(arrcnt)) Xor SERVhex(arrcnt + 5)) Xor SERVhex(arrcnt + 10)) 
 Next 
 reshex(1) = reshex(1) Xor 84  Xor 0 
 reshex(2) = reshex(2) Xor 131 Xor 11 
 reshex(3) = reshex(3) Xor 194 Xor 46 
 reshex(4) = reshex(4) Xor 52  Xor 105 
 reshex(5) = reshex(5) Xor 119 Xor 188 
 hexstr = "0123456789ABCDEF" 
 resstr = "" 
 For arrcnt = 1 To 5 
  hihex = reshex(arrcnt) \ 16 
  lohex = reshex(arrcnt) Mod 16 
  resstr = resstr + Mid(hexstr, hihex + 1, 1) + Mid(hexstr, lohex + 1, 1) 
 Next 
 SolManKeyGen = resstr 
End Function 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/22977/viewspace-707851/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2009-03-28

  • 博文量
    44
  • 访问量
    117508