Windows程序设计(VB.NET)》在线作业一

Windows程序设计(VB.NET)》在线作业一,第1张

C

A

B

B

don't konw

don't konw

don't konw

A

B

don't konw

----------------

B

A

B

A

A

don't konw

B

A

don't konw

don't konw

--------------------------------

累S了

示例:

using System

using System.Collections.Generic

using System.ComponentModel

using System.Data

using System.Drawing

using System.Linq

using System.Text

using System.Windows.Forms

namespace test

{

public partial class Form1 : Form

{

public Form1()

{

InitializeComponent()

}

enum WeekDay { 星期天,星期一,星期二,星期三,星期四,星期五,星期六}

private void button1_Click(object sender, EventArgs e)

{

DateTime dt = Convert .ToDateTime ( textBox1 .Text)

label1.Text = "\n这一天是" + dt.DayOfWeek

WeekDay wd =(WeekDay ) dt.DayOfWeek

label1.Text+= "(即′:"+wd +")"

}

}

}

扩展资料

设计一个简单的Windows程序,输入5个数字,然后排序并输出;

using System

using System.Collections.Generic

using System.ComponentModel

using System.Data

using System.Drawing

using System.Linq

using System.Text

using System.Windows.Forms

namespace bb

{

public partial class Form1 : Form

{

public Form1()

{

InitializeComponent()

}

int[]a=new int[5]

int i = 0

private void button1_Click(object sender, EventArgs e)

{

if (i <5)

{

a[i] = Convert.ToInt32(textBox1.Text)

label2.Text += Convert .ToString( a[i])+"  "

i++

textBox1.Text = ""

}

}

private void Form1_Load(object sender, EventArgs e)

{

label2.Text = "排序前的数字序列:"

}

private void button2_Click(object sender, EventArgs e)

{

Array.Sort(a)

label2.Text += "\n排序后的数字序列:"+a[0]+" "+a[1]+" "+a[2]+" "+a[3]+" "+a[4]

}

}

}


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/7831887.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-10
下一篇 2023-04-10

发表评论

登录后才能评论

评论列表(0条)

保存