dcp*_*dcp 5 vb.net constructor .net-2.0
在C#我可以这样做:
new SomeObjectType("abc", 10);
换句话说,我可以调用 new 而无需将创建的实例分配给任何变量。然而,VB.Net我似乎不能做同样的事情。
New SomeObjectType("abc", 10) ' syntax error
有没有办法做到这一点VB.Net?
查看其他SO 答案的答案
所以这应该有效:
With New SomeObjectType("abc", 10)
End With