vb 2013从函数返回bool

时间:2016-12-06 20:03:24

标签: vb.net

Function checkIsAuthorized(ByVal users As String) As Boolean
    Dim UserJobCode As String = dcChris.getJobCode(users)
    Dim values As String = My.Settings.canResendJobcode
    Dim usersCode As String() = values.Split(",")

    Return usersCode.Contains(UserJobCode)


    'If usersCode.Contains(UserJobCode) Then
    '    canResend = True
    '    Return True
    'End If
    'canResend = False
    'Return False
End Function

该函数的注释部分有效,我只是试图使用return语句使代码更有效。但它并没有回归,因为全球仍在阅读虚假。用旧的方式做到了。

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

Dim canResend As Boolean

函数checkIsAuthorized(ByVal users As String)As Boolean         Dim UserJobCode As String = dcChris.getJobCode(users)         昏暗值As String = My.Settings.canResendJobcode         Dim usersCode As String()= values.Split(“,”)         返回usersCode.Contains(UserJobCode)

End Function

这就是我所确定的。它非常适合我的需求。谢谢大家。