📄 toupiao1.jsp
字号:
<!-toupiao1.jsp-->
<%@ page import="java.util.* " %>
<%@ page import="java.lang.* " %>
<%@ page import=" java.io.*" %>
<html>
<head>
<title>在线投票</title>
<meta http-equiv="content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor="#FFFFFF">
<table width="300" border="1" cellspacing="0" cellpadding="0" >
<tr>
<td>投票题目:你认为JSP容易学么?<td>
</tr>
<form name="toupiao" method="post" action=""toupiao2.jsp" >
<tr>
<td><input type="ratio" name="toup" value="one" checked>较难<br>
<input type="ratio" name="toup" value="two">一般<br>
<input type="ratio" name="toup" value="three">容易<br>
<input type="submit" name="submit" value="提交" >
</td>
</tr>
</form>
<tr>
<td>
<%
String resultsDir="D:";
FileInputStream tfile=new FileInputStream(resultsDir+
System.getProperty("file.separator")+"EE.txt");
String str="";
int c;
while ((c=tfile.read())!=-1)
{
str=str+(char)c;
}
int first=str.indexOf(":");
int last=str.lastIndexOf(":");
int lenth=str.length();
String First=str.substring(0,first);
String Next=str.substring(first+1,last);
String Last=str.substring(last+1,lenth);
tfile.close();
Long a1=new Long(first);
Long a2=new Long(Next);
Long a3=new Long(Last);
long b1=a1.longValue();
long b2=a2.longValue();
long b3=a3.longValue();
long total=b1+b2+b3;
float h0=100*((float)b1/(float)total);
float h1=100*((float)b2/(float)total);
float h2=100*((float)b3/(float)total);
out.println("Select1<img src=dot.gif width="+h0+"height=15"+b1+"<br>");
out.println("Select2<img src=dot.gif width="+h1+"height=15"+b2+"<br>");
out.println("Select3<img src=dot.gif width="+h2+"height=15"+b3+"<br>");
out.println("Total:"+total);
%>
</td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -