Visual Basic基础

1.基本语句使用方法

Select Case语句

'定义参数格式
Dim a, b As String
Dim c As DataTable
Dim d As String=""
Dim student As New Student()

Select Case a
    Case "1"
              b= "aaa "
              Exit Select
    Case "2", "3"
              b= "bbb'" & strSyllabusGUID & "' "
              Exit Select
End Select

 try-catch

Public Shared Function Delete(ByVal ids As String, ByVal user As String) As String
Try
  '代码
Catch ex As Exception
  '异常
End Try
End Function

 If语句

If 1=1 Then
       ' 如果执行成功
        Return "true"
Else
        ' 如果执行失败
       Return "false"
End If

猜你喜欢

转载自www.cnblogs.com/chenze-Index/p/12893068.html
今日推荐