《Web系统与技术》实验报告.docx
《《Web系统与技术》实验报告.docx》由会员分享,可在线阅读,更多相关《《Web系统与技术》实验报告.docx(15页珍藏版)》请在冰豆网上搜索。
![《Web系统与技术》实验报告.docx](https://file1.bdocx.com/fileroot1/2023-4/16/8df558f4-05cf-4888-ae3a-8a00706b080d/8df558f4-05cf-4888-ae3a-8a00706b080d1.gif)
《Web系统与技术》实验报告
武汉工程大学
计算机科学与工程学院
《Web系统与技术》实验报告
专业班级
09信技01班
实验时间
2012年3月2日
学生学号
xxxxx
实验地点
机电大楼411
学生姓名
xx
指导教师
陈艳
实验项目
实验一ASP.NET网站开发基础
实验类别
验证性
实验学时
4
实验目的及要求
实验目的:
熟悉ASP.NET网站的建立、发布和配置;熟悉VS2010界面,掌握网页布局方法;掌握C#基础语法、流程控制与异常处理。
实验内容和要求:
1.参考实验指导书的实验步骤,完成实验1-3。
2.将实验2和实验3的主要代码、运行结果截图填入实验报告。
3.就本次实验遇到的问题和收获作出总结。
报告应在2周内完成,并以学号+姓名+实验一为名上传到FTP上指定文件夹。
成绩评定表
类别
评分标准
分值
得分
合计
上机表现
按时出勤、遵守纪律
认真完成各项实验内容
30分
报告质量
填写内容完整、体现设计过程和结果,实验总结能体现问题和收获
70分
说明:
评阅教师:
陈艳
日期:
年月日
实验内容
(1)用table,Div和CSS对网页布局
(2)利用JavaScript关闭当前窗口
(3)建立表达书籍简易信息的XML格式文件
(4)转换输入的成绩到相应的等级
(5)在Web窗体上输出九九乘法表
(6)输入一组空格间隔的共10个以内的整数,输出该组整数的降序排列。
usingSystem;
usingSystem.Collections.Generic;
usingSystem.Linq;
usingSystem.Web;
usingSystem.Web.UI;
usingSystem.Web.UI.WebControls;
publicpartialclass_Default:
System.Web.UI.Page
{
protectedvoidPage_Load(objectsender,EventArgse)
{
}
protectedvoidbtnSubmit_Click(objectsender,EventArgse)
{
stringsInput=txtInput.Text.Trim()+"";
intj=0;
int[]aInput=newint[10];
stringtemp="";
for(inti=0;i<=sInput.Length-1;i++)
{
if(sInput.Substring(i,1)!
="")
{
temp+=sInput.Substring(i,1);
}
else
{
aInput[j]=int.Parse(temp);
j++;
temp="";
}
}
Array.Sort(aInput);
Array.Reverse(aInput);
foreach(intiinaInput)
{
if(i!
=0)
{
Response.Write(i+" ");
}
}
}
}
(7)计算两个数的商
protectedvoidbtnSubmit_Click(objectsender,EventArgse)
{
try
{
floatdivsor=float.Parse(TxtDivsor.Text);
floatdividend=float.Parse(txtDividend.Text);
Response.Write("商为:
"+divsor/dividend);
}
catch(Exceptionee)
{
Response.Write("请输入正确的数字!
");
}
}
(8)计算用户信息类UserInfo将它用于Web中
<%@PageLanguage="C#"AutoEventWireup="true"CodeFile="Default.aspx.cs"Inherits="_Default"%>
DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http:
//www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
//www.w3.org/1999/xhtml">
LabelID="Label1"runat="server"Text="姓?
名?
:
êo">
Label>
TextBoxID="txtName"runat="server">
TextBox>
LabelID="Label2"runat="server"Text="生¦¨²日¨?
:
êo">
Label>
TextBoxID="txtBirthday"runat="server">
TextBox>
ButtonID="btnSubmit"runat="server"onclick="btnSubmit_Click"Text="提¬¨¢交?
"/>