【发布时间】:2009-02-04 00:00:40
【问题描述】:
我正在重构一些代码,其中一部分包括将其从 VB.Net 迁移到 C#。
旧代码这样声明一个成员:
Protected viewMode As New WebControl
新代码,我终于开始工作了,像这样:
protected WebControl _viewMode = new WebControl(HtmlTextWriterTag.Span);
我可以推测New 关键字的意思是:调用构造函数!但是 VB.Net 是如何调用我无法在 C# 中调用的构造函数(无参数构造函数)的呢?
【问题讨论】:
标签: c# .net asp.net vb.net clr