2013-07-12 58 views
1

我需要定義一個名爲年底對象,因爲我趕上從JSON文件中的一些數據:使用保留字的對象

Imports Microsoft.VisualBasic 

Public Class profesionales 


Private _idResource As Integer 
Private _resourceName As String 
Private _start As String 
Private _End As DateTime 
... 

'This should be End buy is a keyword 
Public Property theEnd As DateTime 

    Get 
     Return _End 
    End Get 

    Set(ByVal value As DateTime) 

     _End = value 
    End Set 

End Property 

JSON文件

[{"idResource":1477,"resourceName":"Juan Llovet Garc\u00EDa","start":"08/07/2013 9:00","end":"08/07/2013 14:00"},{"idResource":1477,"resourceName":"Juan Llovet Garc\u00EDa","start":"08/07/2013 17:00","end":"08/07/2013 20:00"}] 

我怎麼能趕上日期結束

回答

3

你可以用相同名稱的標識符使用括號關鍵字:

public Property [End] As DateTime 

這導致代碼的混亂及應儘量避免使用。