<script language="vbscript" runat="server">
sub application_onstart()
application("sum")=0
end sub
sub session_onstart()
session.timeout=1
application("sum")=application("sum")+1
end sub
sub session_onend()
application("sum")=application("sum")-1
end sub
</script>
完毕. 还有一个简单的HTML嵌套VB脚本的计算器
<html>
<body>
<script language="vbscript">
on error resume next
dim expression
sub addv(cv)
cv=trim(cv)
if( (cv="+") or (cv="-") or (cv="*") or (cv="\")) then
document.f1.resu.value=""
if (right(expression,1)="" or right(expression,1)="+" or right(expression,1)="-" or right(expression,1)="*" or right(expression,1)="\" )then
msgbox("猪头!这样怎么计算啊?")
expression=""
exit sub
end if
end if
expression=expression&cv
document.f1.resu.value=expression
end sub
sub compute()
document.f1.resu.value=eval(expression)
expression=document.f1.resu.value
end sub
sub crt()
expression=""
document.f1.resu.value=""
end sub
</script>
<form name="f1">
<div align="center">
<table width="200" border="1" cellspacing="0" cellpadding="0">
<tr>
<td colspan="4" align="center">甲儿计算器</td>
</tr>
<tr>
<td colspan="4"><div align="center">
<input type="text" name="resu">
</div></td>
</tr>
<tr>
<td><div align="center">
<input type="button" value=" 1 " name="v1" onClick="addv('1')">
</div></td>
<td><div align="center">
<input type="button" value=" 2 " name="v2" onClick="addv('2')">
</div></td>
<td><div align="center">
<input type="button" value=" 3 " name="v3" onClick="addv('3')">
</div></td>
<td><div align="center">
<input type="button" value=" + " name="plus" onClick="addv('+')">
</div></td>
</tr>
<tr>
<td><div align="center">
<input type="button" value=" 4 " name="v4" onClick="addv('4')">
</div></td>
<td><div align="center">
<input type="button" value=" 5 " name="v5" onClick="addv('5')">
</div></td>
<td><div align="center">
<input type="button" value=" 6 " name="v6" onClick="addv('6')">
</div></td>
<td><div align="center">
<input type="button" value=" - " name="minu" onClick="addv('-')">
</div></td>
</tr>
<tr>
<td><div align="center">
<input type="button" value=" 7 " name="v7" onClick="addv('7')">
</div></td>
<td><div align="center">
<input type="button" value=" 8 " name="v8" onClick="addv('8')">
</div></td>
<td><div align="center">
<input type="button" value=" 9 " name="v9" onClick="addv('9')">
</div></td>
<td><div align="center">
<input type="button" value=" * " name="mult" onClick="addv('*')">
</div></td>
</tr>
<tr>
<td colspan="2"><div align="center">
<input type="button" value=" = " name="eqal" onClick="compute()">
</div></td>
<td><input type="button" value=" CR " name="cr" onClick="crt()"></td>
<td><div align="center">
<input type="button" value=" \ " name="divi" onClick="addv('\')">
</div></td>
</tr>
</table>
</div>
</form>
</body>
</html> 我是05计算机系的,QQ37479784,对ASP及ASP.NET感兴趣的可以找我,大家共同进步!
哟,JAVA高手们不出来露两手吗,要是"太阳"公司知道"微软帮"在这里肆虐会哭的.
.net
上面的老兄,我也是对.NET,ASP,感有机会一起聊聊,大家共同进步嘛!:handshake下去打算用ASP.NET来做个学生管理系统,有没有兴趣?一起来哦!:victory: 厉害啊
看不懂
顶一下就好
页:
1
[2]