2015-10-21 155 views
-5

如何將此C#代碼轉換爲VB代碼?需要將此代碼轉換爲vb

public class BasePage : Page 
{ 
    protected override void InitializeCulture() 
    { 
     if (Session["Lang"] != null) 
     { 
      string selectlang = Session["Lang"].ToString(); 
      Culture = selectlang; 
      UICulture = selectlang; 
     } 
     base.InitializeCulture(); 
    } 
} 
+1

爲什麼會是第一個問題跳起我的腦海裏,是爲什麼呢? – fujiFX

+0

我想知道,爲什麼你甚至嘗試[this](http://goo.gl/XXz6XC)? –

+0

[將VB代碼轉換爲C#]可能的重複(http://stackoverflow.com/questions/15945209/converting-a-vb-code-to-c-sharp) – haraman

回答

-1
Public Class BasePage 
    Inherits Page 
    Protected Overrides Sub InitializeCulture() 
     If Session("Lang") IsNot Nothing Then 
      Dim selectlang As String = Session("Lang").ToString() 
      Culture = selectlang 
      UICulture = selectlang 
     End If 
     MyBase.InitializeCulture() 
    End Sub 
End Class