网站建设资讯

NEWS

网站建设资讯

vs下vb点虐 转c# vb 转c#

如何把下面用vb点虐 语言编写的代码改成c#

给你个网站看

敦煌网站建设公司创新互联,敦煌网站设计制作,有大型网站制作公司丰富经验。已为敦煌数千家提供企业网站建设服务。企业网站搭建\外贸营销网站建设要多少钱,请找那个售后服务好的敦煌做网站的公司定做!

可在线将vb点虐 代码转成c#的,我用过,还可以的,但是转后也要改动一些。这里还有将c#转vb点虐 的。

这是我转的:

string[] ArrValue = new string[43];

int Nums;

public void Page_Load(object Sender, EventArgs E)

{

int I;

if (!IsPostBack) {

for (I = 1900; I = 2101; I++) {

ListItem IItem = new ListItem();

IItem.Text = (string)I;

if (I == Year(Now)) {

IItem.Selected = "True";

}

DropYear.items.add(IItem);

}

for (I = 1; I = 12; I++) {

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 = 0; i = 41; i++) {

ArrValue(i) = "";

}

for (i = 0; i = NumOfMonth - 1; i++) {

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;

}

VB.NET object 转换到C#object问题

你实例化对象看看哈

VB 和C# 的object 在变异的时候是不一样的,你不做修改正常出错

object指对象,代表的是通用的对象,就是什么对象都可以表示,new只能表示固定的对象

还有注意一下大小写object和Object是不一样的

在vs2008中怎样将vb的项目转换成c#的项目?

这需要三个步骤:

第一步:创建一个C#项目,在其中添加相应的窗体和引用,将VB2008中相应窗体上的控件复制到C#相应的窗体上;

第二步:使用C#与VB.NET转换工具软件或者到“”,将VB2008 的代码转换成C#代码。

第三步:工具软件或者在线转换,转换后的代码会有一些错误或者无法转换的部分,进行简单的人工修正。

OK,你成功了!


本文题目:vs下vb点虐 转c# vb 转c#
本文URL:http://cdweb.net/article/ddseeoj.html