实验报告(一)
课程名称:.NET程序设计年级:2017级实验日期:姓名:学号:班级:
double b = Convert.ToDouble(Console.ReadLine());
if (a > b)
{
Console.WriteLine("较小的数为:" +b);
}
else if (a < b)
{
Console.WriteLine("较小的数为:"+a);
}
else
{
Console.WriteLine("两个数一样大");
}
Console.ReadKey();
}
}
}
实验结果:
2.实验代码:
using System;
using System.Collections.Generic;
using https://www.doczj.com/doc/2a13920052.html,ponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApplication7
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
enum WeekDay { 星期天, 星期一, 星期二, 星期三, 星期四, 星期五, 星期六};
private void button1_Click(object sender, EventArgs e)
{
DateTime dt = Convert .ToDateTime ( textBox1 .Text);
WeekDay wd =(WeekDay ) dt.DayOfWeek;
label1.Text= "这一天是"+wd+".";
}
}
}
实验结果:
五、总结
本次实验用C#编写了两个简单的任务程序,一个用的是控制台程序,第二
Web程序设计实验报告 姓名:冯刚 学号:200905030324 班级:计科3班
Html代码: 1.首页代码