If DateTime.Now.Hour >12 And DateTime.Now.Hour <18 Then Me.Text = "下午好"
If DateTime.Now.Hour >18 And DateTime.Now.Hour <20 Then Me.Text = "晚上好"
.Net主要包括普通语言运行时(Common Language Runtime)和.Net构架类库。
.Net是为简化在第三代因特网的高分布式环境下的应用程序开发,基于开放互联网标准和协议之上,实现异质语言和平台高度交互性,而构建的新一代计算和通信平台。
扩展资料:
.Net的主要优点有跨语言,跨平台,安全,以及对开放互联网标准和协议的支持。
.Net支持多种语言的互操作,即在一种语言下开发的组件,可在另一组件下通过面向对象的继承而得以重用,目前.Net支持的语言达二十多种。
.Net通过将各语言先编译成中间语言(IL),然后在执行使用即时(Just In Time)编译器将之编译成本地平台代码来实现异构平台下对象的互操作,目前.Net支持的平台有Windows,Linux和Unix的支持正在开发中。
给你个网站看http://www.developerfusion.co.uk/utilities/convertvbtocsharp.aspx可在线将vb.net代码转成c#的,我用过,还可以的,但是转后也要改动一些。这里还有将c#转vb.net的。
这是我转的:
string[] ArrValue = new string[43]
int Nums
public void Page_Load(object Sender, EventArgs E)
{
int I
if (!IsPostBack) {
for (I = 1900I <= 2101I++) {
ListItem IItem = new ListItem()
IItem.Text = (string)I
if (I == Year(Now)) {
IItem.Selected = "True"
}
DropYear.items.add(IItem)
}
for (I = 1I <= 12I++) {
ListItem IItem = new ListItem()
IItem.Text = (string)I
if (I == Month(Now)) {
IItem.Selected = "True"
}
DropMonth.items.add(IItem)
}
}
DispDetail(Conversion.Val(DropYear.SelectedItem.Text), Conversion.Val(DropMonth.SelectedItem.Text))
}
public void DispDetail(int YYear, int MMonth)
{
System.DateTime theDate
int theYear
int theMonth
int theDay
int theWeek
int theFirstNum
int NumOfMonth
int i
string theStr
theYear = YYear
theMonth = MMonth
theDay = 1
//获得所要查询的月的第一天日期
theDate = DateSerial(theYear, theMonth, theDay)
//确定所要查询的第一天是星期几
theWeek = weekday(theDate)
theFirstNum = theWeek
//确定所要查询的月的天数
NumOfMonth = GetDayNum(theyear, themonth)
for (i = 0i <= 41i++) {
ArrValue(i) = ""
}
for (i = 0i <= NumOfMonth - 1i++) {
ArrValue(theFirstNum - 1 + i) = i + 1
}
}
public object GetDayNum(int YYear, int MMonth)
{
object functionReturnValue = null
if (MMonth == 1 | MMonth == 3 | MMonth == 5 | MMonth == 7 | MMonth == 8 | MMonth == 10 | MMonth == 12) {
functionReturnValue = 31
}
else {
if (MMonth == 4 | MMonth == 6 | MMonth == 9 | MMonth == 11) {
functionReturnValue = 30
}
else {
if (((YYear % 4 == 0) &(YYear % 100 != 0)) | (YYear % 400 == 0)) {
functionReturnValue = 29
}
else {
functionReturnValue = 28
}
}
}
return functionReturnValue
}