温馨提示:代码在线浏览功能只能做为源码浏览参考,不能展示项目的全部,如果想更进一步了解该代码请下载:在线订票系统源码(毕业设计)
当前文件路径:TicketOnline/Computer.aspx

1<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Computer.aspx.cs" Inherits="Computer" %> 2
3
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 4
5
<html xmlns="http://www.w3.org/1999/xhtml" > 6
<head runat="server"> 7
<title>Calculate</title> 8
<script language="VBSCRIPT"> 9
Function Show(m) 10
If (Myform.Expression.Value = "" AND InStr(". + - * / ",m)) Then 11
Myform.Expression.Value = "" 12
ElseIf (InStr("+ - * / . ",Right(Myform.Expression.Value,1)) And InStr("+ - * / ",m)) Then 13
ElseIf (m = ".") Then 14
If (InStr("+ - * / . ",Right(Myform.Expression.Value,1))) Then 15
ElseIf ((InstrRev(Myform.Expression.Value,".") > InstrRev(Myform.Expression.Value,"+")) And (InstrRev(Myform.Expression.Value,".") > InstrRev(Myform.Expression.Value,"-")) And (InstrRev(Myform.Expression.Value,".") > InstrRev(Myform.Expression.Value,"*")) And (InstrRev(Myform.Expression.Value,".") > InstrRev(Myform.Expression.Value,"/"))) Then 16
Else 17
Myform.Expression.Value = Myform.Expression.Value + m 18
End If 19
Else 20
Myform.Expression.Value = Myform.Expression.Value + m 21
END If 22
23
End Function 24
25
Function Sqrt() 26
If (Myform.Expression.Value = "") Then 27
Myform.Expression.Value = "" 28
ElseIf (InStr(". + - * / ",Right(Myform.Expression.Value,1))) Then 29
Else 30
Myform.Expression.Value = Eval(Myform.Expression.Value)^2 31
End If 32
33
End Function 34
Function Result() 35
If (Myform.Expression.Value = "") Then 36
Myform.Expression.Value = "" 37
ElseIf (InStr(". + - * / ",Right(Myform.Expression.Value,1))) Then 38
Else 39
Myform.Expression.Value = Eval(Myform.Expression.Value) 40
End If 41
End Function 42
Function Clean() 43
Myform.Expression.Value = "" 44
End Function 45
</script> 46
<style type="text/css"> 47
<!-- 48
.style5 {font-size: 18px} 49
--> 50
</style> 51
</head> 52
<body bgcolor="#ffffee" text=#000000> 53
<form name="myform" method="post" action=""> 54
<div align="center"> 55
<table bgcolor="#C0e0ff" width="214" height="245" border="4"> 56
<tr> 57
<th width="206" scope="col"><H2><font color="#0000A0"> 计算器 </font></H2></th> 58
</tr> 59
<tr> 60
<th height="36" scope="col"><table width="200" border="1"> 61
<tr> 62
<td colspan="4"><div align="center"> 63
<input name="expression" type="text" value="" size="28" maxlength="28" > 64
</div></td> 65
</tr> 66
<tr> 67
<td><div align="center"> 68
<INPUT TYPE="button" id="seven" 69
onClick="Show('7')" VALUE=" 7 "> 70
</div></td> 71
<td><div align="center"> 72
<INPUT TYPE="button" VALUE=" 8 " 73
onClick="Show('8')"> 74
</div></td> 75
<td><div align="center"> 76
<INPUT TYPE="button" VALUE=" 9 " 77
onClick="Show('9')"> 78
</div></td> 79
<td><div align="center"> 80
<INPUT TYPE="button" VALUE=" / " 81
onClick="Show('/')"> 82
</div></td> 83
</tr> 84
<tr> 85
<td><div align="center"> 86
<INPUT TYPE="button" VALUE=" 4 " 87
onClick="Show('4')"> 88
</div></td> 89
<td><div align="center"> 90
<INPUT TYPE="button" VALUE=" 5 " 91
onClick="Show('5')"> 92
</div></td> 93
<td><div align="center"> 94
<INPUT TYPE="button" VALUE=" 6 " 95
onClick="Show('6')"> 96
</div></td> 97
<td><div align="center"> 98
<INPUT TYPE="button" VALUE=" * " 99
onClick="Show('*')"> 100
</div></td> 101
</tr> 102
<tr> 103
<td><div align="center"> 104
<INPUT TYPE="button" VALUE=" 1 " 105
onClick="Show('1')"> 106
</div></td> 107
<td><div align="center"> 108
<INPUT TYPE="button" VALUE=" 2 " 109
onClick="Show('2')"> 110
</div></td> 111
<td><div align="center"> 112
<INPUT TYPE="button" VALUE=" 3 " 113
onClick="Show('3')"> 114
</div></td> 115
<td><div align="center"> 116
<INPUT TYPE="button" VALUE=" - " 117
onClick="Show('-')"> 118
</div></td> 119
</tr> 120
<tr> 121
<td><div align="center"> 122
<INPUT TYPE="button" VALUE=" 0 " 123
onClick="Show('0')"> 124
</div></td> 125
<td><div align="center"> 126
<INPUT TYPE="button" VALUE=" . " 127
onClick="Show('.')"> 128
</div></td> 129
<td><div align="center"> 130
<input type="button" value="sqr" 131
onClick="sqrt()"> 132
</div></td> 133
<td><div align="center"> 134
<input type="button" value=" + " 135
onClick="Show('+')"> 136
</div></td> 137
</tr> 138
<tr> 139
<td colspan="2"><div align="center"> 140
<INPUT TYPE="button" VALUE=" AC " 141
onClick="clean()"> 142
</div></td> 143
<td colspan="2"><div align="center"> 144
<INPUT TYPE="button" VALUE=" = " 145
onClick="result()"> 146
</div></td> 147
</tr> 148
</table></th> 149
</tr> 150
</table> 151






.style5 