代码 - C#到VB

时间:2016-01-24 21:13:53

标签: c# vb.net

我不知道如何将此代码转换为VB

if ((string)Session["type"] != "administrator")
{
    Response.Redirect("login.aspx");
}

2 个答案:

答案 0 :(得分:2)

Telerik Code Converter

If DirectCast(Session("type"), String) <> "administrator" Then
    Response.Redirect("login.aspx")
End If

答案 1 :(得分:0)

以下是转换后的代码:

If DirectCast(Session("type"), String) <> "administrator" Then
    Response.Redirect("login.aspx")
End If