|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
你觉得数据库怎么样?asp.net|技能<%@Pagelanguage="c#"Codebehind="CordBirthday.aspx.cs"AutoEventWireup="false"Inherits="CodeDatum.birthday.CordBirthday"%>
<!DOCTYPEHTMLPUBLIC"-//W3C//DTDHTML4.0Transitional//EN">
<HTML>
<HEAD>
<title>CordBirthday</title>
<metaname="GENERATOR"Content="MicrosoftVisualStudio.NET7.1">
<metaname="CODE_LANGUAGE"Content="C#">
<metaname="vs_defaultClientScript"content="JavaScript">
<metaname="vs_targetSchema"content="http://schemas.microsoft.com/intellisense/ie5">
<scriptlanguage="javascript">
functionshowBirthday(val)
{
varbirthdayValue;
if(15==val.length)
{//15位身份证号码
birthdayValue=val.charAt(6)+val.charAt(7);
if(parseInt(birthdayValue)<10)
{
birthdayValue=20+birthdayValue;
}
else
{
birthdayValue=19+birthdayValue;
}
birthdayValue=birthdayValue+-+val.charAt(8)+val.charAt(9)+-+val.charAt(10)+val.charAt(11);
if(parseInt(val.charAt(14)/2)*2!=val.charAt(14))
document.all.sex.value=男;
else
document.all.sex.value=女;
document.all.birthday.value=birthdayValue;
}
if(18==val.length)
{//18位身份证号码
birthdayValue=val.charAt(6)+val.charAt(7)+val.charAt(8)+val.charAt(9)+-+val.charAt(10)+val.charAt(11)
+-+val.charAt(12)+val.charAt(13);
if(parseInt(val.charAt(16)/2)*2!=val.charAt(16))
document.all.sex.value=男;
else
document.all.sex.value=女;
if(val.charAt(17)!=IDCard(val))
{
document.all.idCard.style.backgroundColor=#ffc8c8;
}
else
{
document.all.idCard.style.backgroundColor=white;
}
document.all.birthday.value=birthdayValue;
}
}
//18位身份证号最初一名校验
functionIDCard(Num)
{
if(Num.length!=18)
returnfalse;
varx=0;
vary=;
for(i=18;i>=2;i--)
x=x+(square(2,(i-1))%11)*parseInt(Num.charAt(19-i-1));
x%=11;
y=12-x;
if(x==0)
y=1;
if(x==1)
y=0;
if(x==2)
y=X;
returny;
}
//求得x的y次方
functionsquare(x,y)
{
vari=1;
for(j=1;j<=y;j++)
i*=x;
returni;
}
</script>
</HEAD>
<bodyMS_POSITIONING="GridLayout">
<formid="Form1"method="post"runat="server">
<tablealign="center">
<tr>
<tdalign="center">身份证:<inputtype="text"name="idCard"id="idCard"></td>
</tr>
<tr>
<tdalign="center">性别:<inputtype="text"name="sex"id="sex"></td>
</tr>
<tr>
<tdalign="center">生日:<inputtype="text"name="birthday"id="birthday"></td>
</tr>
<tr>
<tdalign="center"><inputtype="button"value="OK"></td>
</tr>
</table>
</form>
</body>
</HTML>
也许C#刚上市的时候有些抄袭Java吧,但自从C#2.0上市之后,整个局面就扭转乾坤了,不但Java在模仿C#,而且他从来都没能跟得上C#的脚步。 |
|