ASP用VB脚本语言做简单的计算器在Web中显示

来源:百度知道 编辑:UC知道 时间:2024/05/18 17:52:14
在 IE 中显示 输入任何数值都能进行计算,能在本地中显示

<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312" />
<title>小小asp计算器</title>
</head>

<body>

<%
'-------------------------------
'janchie 原创 2007.3.15

dim str,num1,numtag,num2,action
num1=request.form("num1")
numtag=request.form("numtag")
num2=request.form("num2")
action=request.querystring ("action")
if action="count" then
if not isnumeric(num1) or trim(num1)="" then
response.write "第一项不能为空,且只能填入数字!"
elseif numtag="" then
response.write "运算方式没有选择!"
elseif not isnumeric(num2) or trim(num2)="" then
response.write "第三项不能为空,且只能填入数字!"
else
str=counts(cdbl(num1),numtag,cdbl(num2))
if numtag<>"%" then
if str<1 and str>0 then