What is allowed in Visual Basic that's prohibited in C# (or vice versa)?

后端 未结 21 1892
渐次进展
渐次进展 2020-12-05 06:07

This is code-related as in what the compiler will allow you to do in one language, but not allow you to do in another language (e.g. optional parameters in

21条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-05 06:20

    As Chris Dunaway mentioned, VB.NET has Modules which allow you to define functions and data.

    VB.NET has the VB6 syntax for linking to methods in DLLs. For example:

    Declare SetSuspendState Lib "powrprof" As Function (byval hibernate as Int32, byval forceCritical as Int32, byval disableWakeEvent) as Int32
    

    (Although that actual declaration might have to be Marshalled)


提交回复
热议问题