积极答复者
怎样把以下C#代码转换成VB.net代码

问题
答案
-
你好
以下是 上面的code 的vb version
Public Class Items
Inherits List(Of String)
Public Shadows Default Property Item(index As Integer) As String
Get
Return MyBase.Item(index)
End Get
Set
MyBase.Item(index) = value
End Set
End Property
End Class
希望沒有錯
this 關鍵字 是代表 正在使用中的CLASS 的 意思, 亦都可以用this 來查看現在這個class 的properties / this 关键字用于定义索引器。 在vb中可以用Me
例如
public class test{
private string varA;
private string varB;
public test(string varA, string varB){
this.varA = varA; //這時, 可以把 這個varA 的 VALUE ASSIGN 到 這個CLASS 入面的 varA入面了
this.varB=varB;
}
}
什么是C#的索引器啊
或者可以參考以下urlC#索引器
http://blog.csdn.net/learngis/archive/2009/03/11/3981850.aspx
應該不等同与vb.net的item属性的
Please correct me if my concept is wrong.
Chi- 已标记为答案 网络游侠 2010年8月1日 2:50
全部回复
-
你好
以下是 上面的code 的vb version
Public Class Items
Inherits List(Of String)
Public Shadows Default Property Item(index As Integer) As String
Get
Return MyBase.Item(index)
End Get
Set
MyBase.Item(index) = value
End Set
End Property
End Class
希望沒有錯
this 關鍵字 是代表 正在使用中的CLASS 的 意思, 亦都可以用this 來查看現在這個class 的properties / this 关键字用于定义索引器。 在vb中可以用Me
例如
public class test{
private string varA;
private string varB;
public test(string varA, string varB){
this.varA = varA; //這時, 可以把 這個varA 的 VALUE ASSIGN 到 這個CLASS 入面的 varA入面了
this.varB=varB;
}
}
什么是C#的索引器啊
或者可以參考以下urlC#索引器
http://blog.csdn.net/learngis/archive/2009/03/11/3981850.aspx
應該不等同与vb.net的item属性的
Please correct me if my concept is wrong.
Chi- 已标记为答案 网络游侠 2010年8月1日 2:50