3
問:如何縮短這個數組的創建?
我需要創建一個具有一個屬性的ReportingService2005_WebService.Property類型的數組。縮短VB.NET數組聲明?
喜歡的東西:
Dim PropertyArray() as new ReportingService2005_WebService.Property(1)
我必須這樣做:
Dim PropertyArray As ReportingService2005_WebService.Property() = New ReportingService2005_WebService.Property(0) {}
PropertyArray(0) = New ReportingService2005_WebService.Property
PropertyArray(0).Name = "Description"
PropertyArray(0).Value = "Automatically added DataSource"
需要什麼版本的VB.NET?例如。它會與VB.NET的版本對應於Visual Studio 2008嗎? – 2010-09-15 12:26:43
我使用2008年,這種語法工作正常。 – 2010-09-15 13:35:55
根據我的帖子中的鏈接,它是VB.NET v9,這是VS2008。 – Zippit 2010-09-15 13:41:28