码迷,mamicode.com
首页 > 其他好文 > 详细

【VB6笔记-02】从Command中获取链接参数

时间:2014-05-16 04:55:30      阅读:268      评论:0      收藏:0      [点我收藏+]

标签:style   blog   class   code   c   java   

bubuko.com,布布扣
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
bubuko.com,布布扣

 

【VB6笔记-02】从Command中获取链接参数,布布扣,bubuko.com

【VB6笔记-02】从Command中获取链接参数

标签:style   blog   class   code   c   java   

原文地址:http://www.cnblogs.com/allen0118/p/3726399.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!