|
|
楼主 |
发表于 2010-7-7 22:51:11
|
显示全部楼层
本帖最后由 410521a 于 2010-7-7 22:52 编辑
回复 105# afan
这个好像只是检测位数`` 有没有办法让他检测 号是不是正确?- #include <ButtonConstants.au3>
- #include <EditConstants.au3>
- #include <GUIConstantsEx.au3>
- #include <WindowsConstants.au3>
- #Region ### START Koda GUI section ### Form=
- $Form1 = GUICreate("Form1", 244, 177, 274, 213)
- $Input1 = GUICtrlCreateInput("Input1", 32, 32, 153, 21)
- $Button1 = GUICtrlCreateButton("Button1", 64, 88, 75, 25)
- GUISetState(@SW_SHOW)
- #EndRegion ### END Koda GUI section ###
- While 1
- $nMsg = GUIGetMsg()
- Switch $nMsg
- Case $GUI_EVENT_CLOSE
- Exit
- Case $Button1
- $Str1 = GUICtrlRead($Input1,"")
- If StringRegExp($str1, '^(\d{15}|\d{18})$') Then
- Msgbox(0, $Str1, '是身份证号')
- Else
- Msgbox(0, $Str1, '不是身份证号')
- EndIf
- EndSwitch
- WEnd
复制代码 |
|