我只是想知道在VB.Net中是否有一个相当于这种C#的简写,包括私有的setter: public string Test { get; private set; } 有人可以告诉我在VB.Net中实现这一目标的最短路径吗? 对不起,这是VB.NET中的
public string Test { get; private set; }
有人可以告诉我在VB.Net中实现这一目标的最短路径吗?
对不起,这是VB.NET中的 not possible:Auto-implemented properties are
convenient and support many
programming scenarios. However, there
are situations in which you cannot use
an auto-implemented property and must
instead use standard, or expanded,
property syntax.You have to use expanded
property-definition syntax if you want
to do any one of the following:
- …
- Create properties that are WriteOnly or ReadOnly.
- …