我是一位经验丰富的VB.NET开发人员,他想从C#开始.我正在寻找两种语言语法之间基于网络的比较,以作为快速参考.
我发现自己正在整理VB.NET语法模板,例如…
Public MustInherit Class BaseClass
Public MustOverride Sub PublicMustOverrideSub(ByVal byValParam As Integer, ByRef byRefParam As String)
Protected MustOverride Function ProtectedMustOverrideFunc() As Double
Friend Sub FriendSubWithParamArray(ByVal ParamArray params() As Byte)
End Sub
Private Property PrivateProperty() As Integer
Get
End Get
Set(ByVal value As Integer)
End Set
End Property
Friend ReadOnly Property FriendReadOnlyProperty() As String
Get
Return String.Empty
End Get
End Property
Public WriteOnly Property PublicWriteOnlyProperty() As Double
Set(ByVal value As Double)
End Set
End Property
End Class
…启动Developer Fusion …
public abstract class BaseClass
{
public abstract void PublicMustOverrideSub(int byValParam, ref string byRefParam);
protected abstract double ProtectedMustOverrideFunc();
internal void FriendSubWithParamArray(params byte[] @params)
{
}
private int PrivateProperty {
get { }
set { }
}
internal string FriendReadOnlyProperty {
get { return string.Empty; }
}
public double PublicWriteOnlyProperty {
set { }
}
}
…并消耗结果.但是必须有更好的方法.你认识一个吗
解决方法:
可以在http://www.harding.edu/fmccown/vbnet_csharp_comparison.html找到C#和VB.net代码位的全面比较
关于成为VB开发人员并迁移到C#的很好的文章:http://visualstudiomagazine.com/articles/2008/12/01/what-vb-devs-should-know-about-c.aspx
如果您喜欢网络广播,则有一些非常出色的DNRTV专题节目.明确检查一下:
> Bill Wagner on Learning C#.NET From
VB.NET
> Kathleen Dollard on
Comparing C# and VB in .NET 3.5
> Kathleen Dollard on Comparing C# and
VB in .NET 3.5 Part 2