您好,欢迎访问三七文档
当前位置:首页 > 建筑/环境 > 给排水/暖通与智能化 > C#实习报告
实习报告实习性质:ASP.net初级开发与应用____学生姓名:_______________专业班级:计应102指导教师:实习时间:2011年6月27日-2011年7月1日_实习地点:第四教学楼4312教室重庆工程职业技术学院2011年5月ASP.net实习报告1学生实习考核表学生姓名专业班级指导教师计应102刘宇、邓荣、郑晓蓉实习时间2011年6月27日至2011年7月1日实习地点第四教学楼4312教室实习名称ASP.net初级开发与应用自我总结(包括遵守纪律、增长知识、动手能力、独立工作、团队协作等方面)经过这段时间的上机实习,使我明白了上机的重要性,因为上机可以帮助我们更好的理解程序和进一步的了解它的发展在我们这个领域,因为上机,我们的无限潜能才能被开发出来,所以我们要明白实习虽然累、苦,但是我们一定要克服。毕竟克服了才有所收获嘛,而且还能为我们打下扎实的基础。指导教师意见实习单位意见并盖章(院内实习由系签署)考核等级2011年5月ASP.net实习报告2目录一、实习目的..............................................................................3二、实习任务..............................................................................3三、实习内容..............................................................................3一:学习指导1.................................................................31:使用条件运算符找到较大数.....................................32.给一个长度为6的整数密码加密...............................43.模拟用户登录时的密码验证。...................................54.为商品价格排序...........................................................7二:学习指导2-机票查询及预订功能............................8阶段一:窗体设计及数据库连接。...............................8阶段二:各窗体间的相关代码。.................................11阶段三:实现航班机票查询及预订功能先关信息。24四、实习成果............................................................................24五、实习心得............................................................................242011年5月ASP.net实习报告3一、实习目的加强对课本相关知识的了解,和控制台程序的开发应用与窗体设计开发环境的熟练掌握及其运用到我们的实际生活当中,因为这样我们对他的兴趣才能进一步的融入进去,再加上一周的实习以至于达到学以致用的效果。二、实习任务完成课本知识后的相关内容和机票查询及预定系统,并从中进一步学习课程相关的内容,达到学以致用的效果三、实习内容一:学习指导11:使用条件运算符找到较大数代码:usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;namespaceConsoleApplication1{classProgram{staticvoidMain(string[]args){intmax;Console.WriteLine(--数的大小比较--);Console.Write(请输入第一个数:);intnum1=int.Parse(Console.ReadLine());Console.Write(请输入第二个数:);intnum2=int.Parse(Console.ReadLine());if(num1num2){2011年5月ASP.net实习报告4max=num1;}else{max=num2;}Console.Write(较大的数是:);Console.Write(max);Console.ReadLine();}}}结果:2.给一个长度为6的整数密码加密代码:usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;namespaceConsoleApplication2{classProgram{staticvoidMain(string[]args){stringpwd;//原始密码intpwdInt=0;//转换为整数后的密码stringencrptedPwd=;//加密后的密码int[]pwds=newint[6];//存放加密处理后的密码的数组inttemp;//存放临时数据inti;//循环变量Console.WriteLine(--密码加密--);Console.WriteLine(请输入一个长度为6的整数,作为你的原始密码);2011年5月ASP.net实习报告5do//接收输入的密码{pwd=Console.ReadLine();if(pwd.Length!=6){Console.WriteLine(密码长度不正确,请输入一个长度为6位的密码!);}}while(pwd.Length!=6);pwdInt=int.Parse(pwd);//将输入的字符串转换为整数for(i=0;i6;i++)//将密码拆分为一个数组{pwds[i]=pwdInt%10;pwdInt=pwdInt/10;}for(i=0;i6;i++)//加密{pwds[i]+=5;pwds[i]=pwds[i]%10;}temp=pwds[0];//将第一位和最后一位交换pwds[0]=pwds[5];pwds[5]=temp;for(i=5;i=0;i--)//得到加密后的新密码{encrptedPwd=encrptedPwd+pwds[i];}Console.WriteLine(加密后的密码为:+encrptedPwd);Console.ReadLine();}}}结果:3.模拟用户登录时的密码验证。代码:2011年5月ASP.net实习报告6usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;namespaceConsoleApplication3{classProgram{staticvoidMain(string[]args){intcount=1;strings=123456;stringd=111;stringa;stringb;Console.WriteLine(--请输入用户名和密码进行登陆--);//Console.WriteLine(用户名:123456);//Console.WriteLine(密码:111\n);do{Console.WriteLine(请输入正确的用户名或密码!);Console.Write(用户名:);a=Console.ReadLine();Console.Write(密码:);b=Console.ReadLine();if(a==s&&b==d){Console.WriteLine(恭喜你!登录成功!);break;}else{count++;}if(count3){Console.WriteLine(你当前的操作频繁,请稍候再试!);break;}}while(count=3);Console.ReadLine();2011年5月ASP.net实习报告7}}}结果:4.为商品价格排序代码:usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;namespaceConsoleApplication3{classProgram{staticvoidMain(string[]args){int[]scores=newint[8];inti,j;inttemp;Console.WriteLine(--商品价格排序--);Console.WriteLine(请输入8件商品的价格);for(i=0;i8;i++){Console.Write(请输入第{0}件商品的价格:,i+1);scores[i]=int.Parse(Console.ReadLine());}for(i=0;iscores.Length-1;i++){for(j=0;jscores.Length-1-i;j++){2011年5月ASP.net实习报告8if(scores[j]scores[j+1]){temp=scores[j];scores[j]=scores[j+1];scores[j+1]=temp;}}}Console.WriteLine(从高到低排序后的价格为:);for(i=0;iscores.Length;i++){Console.Write({0}\t,scores[i]);}Console.WriteLine();Console.ReadLine();}}}结果:二:学习指导2-机票查询及预订功能.阶段一:窗体设计及数据库连接。1:用户登录界面。2011年5月ASP.net实习报告92:查询用户、航班、定票信息2011年5月ASP.net实习报告103:机票查询及预订。4:用户注册。5:所需的数据库。1:用户注册信息。2011年5月ASP.net实习报告112:航班信息。3预订信息。阶段二:各窗体间的相关代码。1:用户登录窗体:usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Data.SqlClient;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;namespace学习指导2{publicpartialclassForm2:Form{2011年5月ASP.net实习报告12publicForm2(){InitializeComponent();}privatevoidForm2_Load(objectsender,EventArgse){stringsa=生分证;comboBox1.Text=sa.ToString();}privatevoidbutton1_Click(objectsender,EventArgse){if(textBox1.Text==){MessageBox.Show(请输入用户名,提示);}elseif(comboBox1.Text==){MessageBox.Show(请选择证件类型,提示);}elseif(textBox2.Text==){MessageBox.Show(请输入证件号码,提示);}elseif(textBox3.Text==){MessageBox.Show(请输入密码,提示);}else{stringst=select用户名,证件类型,证件号,用户密码fromimformaionwhere用户名='+textBox1.Text+'and证件类型
本文标题:C#实习报告
链接地址:https://www.777doc.com/doc-4710095 .html