VB.NET与C#的语法比较

这是我自己整理的,环境是 .NET Framework 4.8+VS2019。

VB的关键词列表
C#的关键词列表

VB.NETC#
Private Module Module1internal sealed class Module1 (sealed就是不可继承)
Error 5throw ProjectData.CreateProjectError(5);
Public Delegate Sub adelegate(ByRef m As Single)public delegate void adelegate(ref float m);
Public MustInherit Class MustInheritnamepublic abstract class MustInheritname
Public Event goevent(a As Integer, b As Integer)private goeventEventHandler goeventEvent;
public delegate void goeventEventHandler(int a, int b);
RaiseEvent goevent(15, 35)goeventEvent?.Invoke(15, 35);
Public Overridable Sub dsadsa(ParamArray objs() As Object)public virtual void dsadsa(params object[] objs)
Public WriteOnly Property writeonlyone As Integer
Set(value As Integer)
End Set
End Property
public int writeonlyone
{
set{}
}
Friend Const this As Stringinternal const string @this
Public NotInheritable Class publicname
Inherits MustInheritname
Implements IComparable
Public Sub New()
public sealed class publicname : MustInheritname, IComparable
public publicname()
Public MustOverride Property youmustoverridethis As Integerpublic abstract int youmustoverridethis
ReDim Preserve m(16)i = (int[])Utils.CopyArray(i, new int[17]);