首页 > 代码库 > 【VB6笔记-02】从Command中获取链接参数
【VB6笔记-02】从Command中获取链接参数
Public Sub GetParameters() Dim Para As String Para = Command$() gstrUserID = GetCommandPara(Para, 1) gstrDSN = GetCommandPara(Para, 2) gstrSQLUserID = GetCommandPara(Para, 3) gstrPassWord = GetCommandPara(Para, 4) gstrServerName = GetCommandPara(Para, 5) gstrDataBaseName = GetCommandPara(Para, 6) gstrCompanyCode = GetCommandPara(Para, 7) gblnAllowAdd = IIf(UCase(GetCommandPara(Para, 8)) = "Y", True, False) gblnAllowEdit = IIf(UCase(GetCommandPara(Para, 9)) = "Y", True, False) gblnAllowDelete = IIf(UCase(GetCommandPara(Para, 10)) = "Y", True, False) gblnAllowSpecial = IIf(UCase(GetCommandPara(Para, 11)) = "Y", True, False) End Sub Public Function GetCommandPara(CommandStr As String, ParaNum As Integer) As String #If c_IssueVersion Then On Error GoTo GetCommandPara_Err #End If Dim OrigCmdStr As String Dim i As Integer Dim j As Integer ReDim PosArray(0 To 20) OrigCmdStr = RTrim$(LTrim$(CommandStr)) PosArray(0) = 0 j = 1 For i = 1 To Len(OrigCmdStr) If Mid$(OrigCmdStr, i, 1) = "~" Then PosArray(j) = i j = j + 1 End If Next i PosArray(j) = Len(OrigCmdStr) + 1 GetCommandPara = Mid$(OrigCmdStr, PosArray(ParaNum - 1) + 1, PosArray(ParaNum) - PosArray(ParaNum - 1) - 1) Exit Function GetCommandPara_Err: Call ErrHandler("The application can not get information to Login Server!", "Load Form") End Function
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。