2013-08-19 99 views
-7

我有這樣的CSHARP代碼,我想轉換爲vb.net:轉換CSHARP代碼vb.net

var item = (from l in List2 select l).FirstOrDefault(); 
if(item != null) {...} 

轉換到VB:

Dim item = (from l in List2 select l).FirstOrDefault() 
If item <> Nothing Then ... End If 

但得到錯誤項目<>沒有

+0

什麼是錯誤? –

+0

花了2秒鐘的谷歌搜索 - http://msdn.microsoft.com/en-us/library/t3bat82c.aspx –

+0

花了1秒鐘的谷歌搜索http://www.developerfusion.com/tools/convert/csharp-to- VB / – wudzik

回答

4

嘗試

If item IsNot Nothing Then