function sfzjy(num)
if len(num)=15 then
cID = left(num,6)&"19"&right(num,9)
elseif len(num)=17 or len(num)=18 then
cID = left(num,17)
end if
nSum=mid(cID,1,1) * 7
nSum=nsum+mid(cID,2,1) * 9
check_number=12-nsum mod 11
If check_number=10 then
check_number="X"
elseIf check_number=12 then
check_number="1"
elseif check_number=11 then
check_number="0"
End if
sfzjy=check_number
End function
function chk()
xian=Trim(usercode.value)
iscode = false
if (len(xian)=15) then
if (IsNumeric(xian)) then iscode = true
elseif (len(xian)=18) then
if (IsNumeric(xian)) then
iscode = true
elseif (IsNumeric(left(xian,17)) and right(xian,1)="x") then
iscode = true
end if
end if
if (iscode) then
lenx=len(xian)
if lenx=15 then
aa=mid(xian,15,1)
end if
if lenx=18 then
aa=mid(xian,17,1)
end if
if aa mod 2=0 then
xb="female"
else
xb="male"
end if
if lenx=18 then
if mid(xian,18,1)<>cstr(sfzjy(xian)) then
jieguo.value = "error"
else
jieguo.value = "ok"
get_code_area(xian)
end if
else
xian = left(xian,6)&"19"&right(xian,9)&cstr(sfzjy(xian))
jieguo.value = "new:"&xian
get_code_area(xian)
end if
else
jieguo.value = "input error"
end if
End function
function getcode()
if (chkinput()) then
dim i
code = left(area3.value,6)
list = ""
if Len(yy.value)=2 then
code = code&"19"&yy.value
else
code = code&yy.value
end if
code = code&chknum(mm.value)&chknum(dd.value)
Randomize
for i=1 to 10
temp = code&getrnd(int(499* Rnd)*2+cint(sex.value))
temp = temp&sfzjy(temp&"1")
list = list&temp&chr(10)&chr(13)
next
code_list.value = list
end if
end function
function getrnd(code)
select case len(code)
case 0:getrnd="000"
case 1:getrnd="00"&cstr(code)
case 2:getrnd="0"&cstr(code)
case 3:getrnd=cstr(code)
end select
end function
function chknum(num)
dim temp
temp = cint(num)
if temp<10 then
chknum = "0"&temp
else
chknum = temp
end if
end function
if len(num)=15 then
cID = left(num,6)&"19"&right(num,9)
elseif len(num)=17 or len(num)=18 then
cID = left(num,17)
end if
nSum=mid(cID,1,1) * 7
nSum=nsum+mid(cID,2,1) * 9
check_number=12-nsum mod 11
If check_number=10 then
check_number="X"
elseIf check_number=12 then
check_number="1"
elseif check_number=11 then
check_number="0"
End if
sfzjy=check_number
End function
function chk()
xian=Trim(usercode.value)
iscode = false
if (len(xian)=15) then
if (IsNumeric(xian)) then iscode = true
elseif (len(xian)=18) then
if (IsNumeric(xian)) then
iscode = true
elseif (IsNumeric(left(xian,17)) and right(xian,1)="x") then
iscode = true
end if
end if
if (iscode) then
lenx=len(xian)
if lenx=15 then
aa=mid(xian,15,1)
end if
if lenx=18 then
aa=mid(xian,17,1)
end if
if aa mod 2=0 then
xb="female"
else
xb="male"
end if
if lenx=18 then
if mid(xian,18,1)<>cstr(sfzjy(xian)) then
jieguo.value = "error"
else
jieguo.value = "ok"
get_code_area(xian)
end if
else
xian = left(xian,6)&"19"&right(xian,9)&cstr(sfzjy(xian))
jieguo.value = "new:"&xian
get_code_area(xian)
end if
else
jieguo.value = "input error"
end if
End function
function getcode()
if (chkinput()) then
dim i
code = left(area3.value,6)
list = ""
if Len(yy.value)=2 then
code = code&"19"&yy.value
else
code = code&yy.value
end if
code = code&chknum(mm.value)&chknum(dd.value)
Randomize
for i=1 to 10
temp = code&getrnd(int(499* Rnd)*2+cint(sex.value))
temp = temp&sfzjy(temp&"1")
list = list&temp&chr(10)&chr(13)
next
code_list.value = list
end if
end function
function getrnd(code)
select case len(code)
case 0:getrnd="000"
case 1:getrnd="00"&cstr(code)
case 2:getrnd="0"&cstr(code)
case 3:getrnd=cstr(code)
end select
end function
function chknum(num)
dim temp
temp = cint(num)
if temp<10 then
chknum = "0"&temp
else
chknum = temp
end if
end function
解决方案 »
- JS传递参数到另一个页面的问题
- 星期一中午12点之后就不可再添加和修改,这个如果用js限制要怎么做
- 技术性问题,希望有做过公式编辑器的高手指点1,2(分很少,希望谅解)
- 【急】如何转向新的页面?
- 页面空白处引发鼠标事件
- 如何在火狐狸中改变层内文字?火狐狸是不认innerText吗?
- mozilla中的click()?
- javascript中怎么获得用户的输入,在TEXT中
- javascript高手请看过来
- 请问解决整数,货币,INT,DOUBLE,等类型的JavaScript验证--这个问题我过去提过,而且结贴,忽然发现并没有解决我的问题!只好旧话重提
- widget开发中,浏览器如何解析icon
- JS组织结构图(子节点三个以下不出错,子节点四个以上就出错了)
function VbFun()
dim name
name="Mike"
alert(name)
end function
</script>
<script language="javascript" type="text/javascript">
VbFun(); //js直接可以调用
</script>