如何将Windows序列号分段显示

来源:互联网 发布:数据建模方法 编辑:程序博客网 时间:2024/05/18 04:51

Windows序列号格式:XXXXX-XXXXX-XXXXX-XXXXX-XXXXX

Dim $k1 = "", $k2 = "", $k3 = "", $k4 = "", $k5 = ""“

$Key = "MRX3F-47B9T-2487J-KWKMF-RPWBY"

 $Key = StringReplace($Key, "-", "")

 $key_1 = StringLeft($Key, 5)
 If $key_1 <> $k1 Then
  $k1 = $key_1
  GUICtrlSetData($InputKey_1, $key_1)
 EndIf

 $2 = StringLeft($Key, 10)
 $key_2 = StringRight($2, 5)
 If $key_2 <> $k2 Then
  $k2 = $key_2
  GUICtrlSetData($InputKey_2, $key_2)
 EndIf

 $3 = StringRight($Key, 15)
 $key_3 = StringLeft($3, 5)
 If $key_3 <> $k3 Then
  $k3 = $key_3
  GUICtrlSetData($Inputkey_3, $key_3)
 EndIf

 $4 = StringRight($Key, 10)
 $key_4 = StringLeft($4, 5)
 If $key_4 <> $k4 Then
  $k4 = $key_4
  GUICtrlSetData($InputKey_4, $key_4)
 EndIf

 $key_5 = StringRight($Key, 5)
 If $key_5 <> $k5 Then
  $k5 = $key_5
  GUICtrlSetData($InputKey_5, $key_5)
 EndIf

可将序列号分段显示在输入框控件中。

原创粉丝点击