Static variables in C#

前端 未结 5 570
梦如初夏
梦如初夏 2021-01-17 11:28

In C#, is there a way to put a static variable in a method like VB.Net?

Static myCollection As Collection
5条回答
  •  北荒
    北荒 (楼主)
    2021-01-17 11:47

    No, The CLR does not support this, and VB.NET resorts to compiler tricks to allow it. Ugh.

提交回复
热议问题