可以试试VBto Converter
VBto Converter是一款VB语言转换软件,它支持将MS Visual Basic资源文件(包括源代码)转换成MS VC++ MFC, VC++.NET (CLR), VBNET, C#, J#, Borland C++ Builder, Borland Delphi源文件.
给你个网站看
可在线将vb.net代码转成c#的,我用过,还可以的,但是转后也要改动一些.这里还有将c#转vb.net的.
这是我转的:
int Nums;
public void Page_Load(object Sender, EventArgs E)
{
int I;
if (!IsPostBack) {
ListItem IItem = new ListItem();
IItem.Text = (string)I;
if (I == Year(Now)) {
IItem.Selected = "True";
}
DropYear.items.add(IItem);
if (I == Month(Now)) {
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);
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;
else {
return functionReturnValue;
你实例化对象看看哈
VB 和C# 的object 在变异的时候是不一样的,你不做修改正常出错
object指对象,代表的是通用的对象,就是什么对象都可以表示,new只能表示固定的对象
还有注意一下大小写object和Object是不一样的
这需要三个步骤:
第三步:工具软件或者在线转换,转换后的代码会有一些错误或者无法转换的部分,进行简单的人工修正.
OK,你成功了!
以上就是土嘎嘎小编为大家整理的vb.net项目转c相关主题介绍,如果您觉得小编更新的文章只要能对粉丝们有用,就是我们最大的鼓励和动力,不要忘记讲本站分享给您身边的朋友哦!!