0
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語句使代碼更高效。但是它不會返回一個布爾值,因爲全局仍然是錯誤的。以舊的方式工作。vb 2013從函數返回bool
任何想法?
如果您還想設置'canResend',則需要兩個語句'canResend = usersCode.Contains(UserJobCode)',接着是'Return canResend'。 – Blackwood