Does any one know why the following code works the way? and in C# it works in a different way what is the meaning of "Me" in VB.NET and why is it different than in C#
Structure Test
Private mName As String
Property Name() As String
Get
Return Me.mName
End Get
Set(ByVal Value As String)
Me.mName = Value
End Set
End Property
Sub foo(ByVal s As String)
Me.Name = s 'this line fails
Name = s 'this line does not fail
End Sub
End Structure
C# code
struct Test
{
string mName;
public string Name
{
get
{
return this.mName;
}
set
{
this.mName = value;
}
}
public void foo(string s)
{
this.Name = s; //no error
}
}