吾爱破解 - LCG - LSG |安卓破解|病毒分析|www.52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 9038|回复: 44
收起左侧

[Java 转载] 刚刚做了个计算机报考网页登录界面,很简单的一个界面,才开始学习,所以不是很好

  [复制链接]
xiaohai 发表于 2014-9-27 17:23
第一个界面:报考计算机登录界面
<%@ page contentType="text/html; charset=GB2312" %>
<%@ page import ="java.util.*" %>
<html>
  <head>
    <title>计算机报考页面</title><br>
  </head>
  <body bgcolor="cyan">
  <form method="post" action="ch4_6_show.jsp" name="form1">
<h2><p align="center">网上计算机考试报名系统</h2>
考生姓名:<input type="text" name="stuName" size="8" align="left"><br><br>
登录密码:<input type="password" name="stuPassword" size="8" align="left"><br><br>
性&nbsp;&nbsp;别:<input type="radio" name="stuSex" value="男" checked="" align="left">男
   <input type="radio" name="stuSex" value="女"  align="left">女<br><br>
         
报考科目:<input type="checkbox" name="course" value="Windows  XP">Windows  XP
<input type="checkbox" name="course" value="WPS office">WPS office
<input type="checkbox" name="course" value="Java 程序设计">Java程序设计<br><br>
   

学历:<select name="level">
<option value="专科">专科</option>
<option value="本科">本科</option>
<option value="研究生">研究生</option>
<option value="博士">博士</option>
</select><br><br>

报考级别:<select name="exmaclass" size="2">
    <option value="高级" selected="true">高级</option>
    <option value="中级">中级</option>
</select><br><br>
备注:<textarea name="memo"rows="8" cols="30">在这里输入您报考的备注信息
</textarea><br><br>

<input type="submit" name="submit" value="提交" size="5">
<input type="reset" name="reset" value="重置" size="5">

  </form>
  </body>
</html>
第二个,显示你报考计算机登录的信息
<%@ page contentType="text/html; charset=GB2312" %>
<%@ page import="java.util.*" %>

<%!
public String chString(String s)
    {
String str=s;
try
{
  byte b[]=str.getBytes("ISO-8859-1");
str =new String(b);
return str;
}
catch(Exception e)
{
return str;
}
   }
%>
<html>
<head>
  <title>My JSP 'ch4_5_show.jsp' starting page</title>     
  </head>
  <body bgcolor="cyan">
<%
String strName=request.getParameter("stuName");   //提取信息
String strPassword=request.getParameter("stuPassword");
String strSex=request.getParameter("stuSex");
String strCourse[]=request.getParameterValues("course");
String strSubmit=request.getParameter("submit");
String strLevel=request.getParameter("level");
String strExamclass=request.getParameter("exmaclass");
String strMemo=request.getParameter("memo");

strName=chString(strName);   //转码,转为汉字
strSex=chString(strSex);
strcheckbox=chString(checkbox);
strHinfo=chString(strHinfo);
strSubmit=chString(strSubmit);
strLevel=chString(strLevel);
strExamclass=chString(strExamclass);
strMemo=chString(strMemo);

out.print("<h2>网上计算机考试报名系统信息显示:</h2>");   //输出结果
out.print("<br>考生姓名:");
out.print(strName);
out.print("<br>登录密码:");
out.print(strPassword);
out.print("<br>性&nbsp;&nbsp;别:");
out.print(strSex);

out.print("<br>报考科目:");
if(strCourse==null)
out.print("没有选课");
else
  {
for(int k=0; k<strCourse.length;k++)
{
  out.print(chString(strCourse[k])+"&nbsp;&nbsp;");
}
}
  
out.print("<br>学历:");
out.print(strLevel);
out.print("<br>报考级别:");
out.print(strExamclass);
out.print("<br>备注:");
out.print(strMemo);
out.print("<br>提交按钮:");
out.print(strSubmit+" ");

  %>
  </body>
</html>


免费评分

参与人数 1热心值 +1 收起 理由
orachard + 1 热心回复!

查看全部评分

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

a1036862671 发表于 2014-11-11 18:09
堕落ぁ狼 发表于 2014-9-27 17:49
签名档是神马动漫?

点开你就知道。。。我是雷锋
堕落ぁ狼 发表于 2014-9-27 17:49
winne381400612 发表于 2014-11-27 05:45
 楼主| xiaohai 发表于 2015-2-16 21:35

什么问题呢?指教一二,谢谢!
seemk 发表于 2014-11-27 11:48
怎么连个图都没有啊,还想看看你的布局、美工怎么样呢
791898456 发表于 2014-9-27 17:29
不明觉历多谢分享
、稻草人 发表于 2014-9-27 17:30
虽然看不懂还是顶下!
小艾. 发表于 2014-9-27 17:36
很不错,感谢分享
Bad丶Boy 发表于 2014-9-27 17:41
菜鸟看不懂
懒惰的上帝 发表于 2014-9-27 17:44
人才~~~~~~~~~~~
 楼主| xiaohai 发表于 2014-9-27 17:45

不懂?可以问的咯
 楼主| xiaohai 发表于 2014-9-27 17:49

没拉....刚学,很简单啦
1273002707 发表于 2014-9-27 18:10
哇塞,我也想学习。
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

快速回复 收藏帖子 返回列表 搜索

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-9-23 07:33

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表