⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mainpage.frm

📁 用vb实现在线考试系统
💻 FRM
📖 第 1 页 / 共 5 页
字号:
err:
          MsgBox err.Description
End Sub

'声音按钮
Private Sub imageSound_Click()
        Dim i As Integer
        If flag3 = False Then
            flag3 = True
            
'            cmdPlaySound.Caption = "打开声音"
            imageSound.Picture = LoadPicture()
            
            For i = 0 To 15
                If ifRecord(i) Then
                   Cli_PlaySound stockhandle(i)
                End If
            Next i
        Else
            flag3 = False
'            cmdPlaySound.Caption = "关闭声音"
            imageSound.Picture = LoadPicture(App.Path & "\res\静音.jpg")
            Cli_CloseSound
        End If
End Sub

Private Sub Form_Activate()

        If flag8 = False Then
           flag8 = True
            iTotalChannel = Cli_Startup_card
            GetPlayPara
        End If

End Sub

'视频显示函数
Public Sub GetPlayPara()
On Error Resume Next
        Dim i As Integer
        Dim j As Integer
        Dim IniFileName  As String
        Dim k As Integer
       
        
       
        For i = 0 To 15
       
            If stockhandle(i) >= 0 Then
              
              
              Cli_Stop stockhandle(i)
            
            End If
        Next i

       
        k = 0
        IniFileName = "StartPlayPara.ini"
        iShowNum = GetIni(IniFileName, "TotalNum", "TotalNum", "0")
        
        For i = 0 To iShowNum - 1
           Channel(i, 2) = GetIni(IniFileName, "视频" & i, "服务器号", "-1")
           Channel(i, 0) = GetIni(IniFileName, "视频" & i, "服务器IP", "-1")    '服务器ip
           Channel(i, 1) = GetIni(IniFileName, "视频" & i, "通道号", "-1")
           Channel(i, 3) = GetIni(IniFileName, "视频" & i, "安装地点", "0")
            j = 0
            Do While (j < i)
                If Channel(i, 0) = Channel(j, 0) Then
                    Exit Do
                Else
                    j = j + 1
                End If
            Loop

            If j = i Then
                strServerIP(k) = Channel(i, 0)
                k = k + 1
            End If
                        
           If Channel(i, 1) <> -1 Then
              ifRecord(i) = True
              stockhandle(i) = Cli_PlaySoft(MainPage.PicVideo(i).hwnd, Channel(i, 1), m_linktype, Channel(i, 0), UserName, UserPassword, 1)
              Debug.Print "返回值:" & stockhandle(i)
           End If
           
           PlayTime = True
        Next i
        
        Debug.Print "k:" & k
        Winsockclient.Close
        Winsockclient.Protocol = sckUDPProtocol
        Winsockclient.LocalPort = 10029
        Winsockclient.RemotePort = 10030
        Winsockclient.Bind 10029
        
        iServerNum = k - 1
        
        For i = 0 To k - 1
            Debug.Print strServerIP(i)
            Winsockclient.RemoteHost = strServerIP(i)
            Winsockclient.SendData "S1"
        Next i
        
'----------------------播放质量------------------------
        PlayQuality = GetIni("XTPZ.ini", "SetUp", "播放质量", "-1")
        
        For i = 0 To 23
         If stockhandle(i) >= 100 Then
           Cli_PlayDelayType stockhandle(i), PlayQuality
        End If
        Next i
        
        frmSetPara.Label12.Caption = "播放质量:" & PlayQuality + 1 & "级"
        
        PlayCount = PlayCount + 1
   
End Sub

Private Sub Command15_Click()

        Dim i As Integer
        For i = 0 To 31
            If stockhandle(i) >= 0 Then
               Cli_ClientThrowBFrame stockhandle(i), m_bframenum
            End If
        Next i
End Sub

'窗体初始化
Private Sub Form_Load()
On Error GoTo a1
       Cli_ClientStart 5050, 6050
    
       bswitch = 0
      
       Volume = &HF000
       CurrentNum = -1
       
'       Label6.Visible = False
       Label6.Caption = ""
       
       Dim i As Integer
       Dim j As Integer
    
       
       For i = 0 To 23
          stockhandle(i) = -1
       Next i

       For i = 1 To 4
            gWhichToShow4(i) = i
       Next i
       
       
       For i = 1 To 9
            gWhichToShow9(i) = i
       Next i
       
        For i = 1 To 16
            gWhichToShow16(i) = i
       Next i
       
       
       For i = 1 To 63
            Load PicVideo(i)
            PicVideo(i).Visible = True
        Next i
        
        iNext = 0
        Show16Windows
        Num = 16
        bswitch = 16
            ServerName(1) = "服务器00"
            ServerName(2) = "服务器01"
            ServerName(3) = "服务器02"
            ServerName(4) = "服务器03"
            ServerName(5) = "服务器04"
            ServerName(6) = "服务器05"
            ServerName(7) = "服务器06"
            ServerName(8) = "服务器07"
            ServerName(9) = "服务器08"
            ServerName(10) = "服务器09"
            ServerName(11) = "服务器10"
            ServerName(12) = "服务器11"
            ServerName(13) = "服务器12"
            ServerName(14) = "服务器13"
            ServerName(15) = "服务器14"
            ServerName(16) = "服务器15"
      
     
      
      '*****录像*******
      For i = 0 To 3
      If frmSetPara.Combo2.ListIndex = i Then
          DriveName = frmSetPara.Combo2.Text
      End If
      Next i
    
    flag4 = False
    
    chkAutoRecord.Value = vbChecked
    
    WinsockEvents.Bind 10031
    
    '-------------------系统设置------------------------------
    DriveName = GetIni("XTPZ.ini", "SetUp", "录像盘符", "0")
    
    If Dir(DriveName + ":\save", vbDirectory) = "" Then
      MkDir DriveName & ":\save"
    End If
    If Dir(DriveName + ":\Picture", vbDirectory) = "" Then
      MkDir DriveName & ":\Picture"
    End If

    SwitchInterval = 5
    labRecord.Caption = SwitchInterval

    For i = 0 To 15
    GetWeekSets1 i
    Next i
    
    '---------------改变云台调节数度-------------------
    Slider1.Max = 63
    Slider1.Min = 32
    
    YunTaiSpeed = Slider1.Value
    YunTaiSpeed = Hex(YunTaiSpeed)
    Slider1.ToolTipText = YunTaiSpeed
      
'    ''''传递句柄'''''
'    Cli_GetWnd Text1.hwnd

a1:
    MsgBox "出错:" & err.Description, vbInformation
End Sub

' 获取指定卡定时参数设置
Private Sub GetWeekSets1(ByVal iChannelNo As Integer)
Dim i As Integer
Dim IniFileName  As String

    IniFileName = gGetIniPath & "通道" & iChannelNo + 1 & ".ini"

      For j = 0 To 23
          i = GetPrivateProfileInt("星期1", "RecordSegment" & j, -1, IniFileName)
         
          If (i >= 0) Then
             bChoose(iChannelNo, 1, j) = j + 1
          ElseIf (i = -1) Then
             bChoose(iChannelNo, 1, j) = -1
          End If
      Next j
    
      For j = 0 To 23
          i = GetPrivateProfileInt("星期2", "RecordSegment" & j, -1, IniFileName)
          
          If (i >= 0) Then
             bChoose(iChannelNo, 2, j) = j + 1
          ElseIf (i = -1) Then
             bChoose(iChannelNo, 2, j) = -1
          End If
      Next j
      
      For j = 0 To 23
          i = GetPrivateProfileInt("星期3", "RecordSegment" & j, -1, IniFileName)
          If (i >= 0) Then
             bChoose(iChannelNo, 3, j) = j + 1
          Else: bChoose(iChannelNo, 3, j) = -1
          End If
      Next j
      
      
      For j = 0 To 23
          i = GetPrivateProfileInt("星期4", "RecordSegment" & j, -1, IniFileName)
          If (i >= 0) Then
             bChoose(iChannelNo, 4, j) = j + 1
           Else: bChoose(iChannelNo, 4, j) = -1
          End If
      Next j
      
      For j = 0 To 23
          i = GetPrivateProfileInt("星期5", "RecordSegment" & j, -1, IniFileName)
          If (i >= 0) Then
              bChoose(iChannelNo, 5, j) = j + 1
          Else: bChoose(iChannelNo, 5, j) = -1
          End If
      Next j
      
      For j = 0 To 23
          i = GetPrivateProfileInt("星期6", "RecordSegment" & j, -1, IniFileName)
          If (i >= 0) Then
             bChoose(iChannelNo, 6, j) = j + 1
         Else: bChoose(iChannelNo, 6, j) = -1
          End If
      Next j
      
      For j = 0 To 23
          i = GetPrivateProfileInt("星期日", "RecordSegment" & j, -1, IniFileName)
          If (i >= 0) Then
             bChoose(iChannelNo, 7, j) = j + 1
          Else: bChoose(iChannelNo, 7, j) = -1
          End If
      Next j
      
    
End Sub
Private Sub Form_Unload(Cancel As Integer)
        End
End Sub

Private Sub GetPlayParameter(Index As Integer)
 
 '---------------获取总体配置擦数-----
        TotalShowNum = GetIni("TVPara.ini", "TotalNum", "TotalNum", 0)
        CurrentNum = PicVideo(Index).Index
        Label6.Caption = "所选的通道号:" & CurrentNum + 1
        'TVPara.ini  为各端服务器配置文件的合成
        
        For i = 0 To TotalShowNum - 1
            ChannelPara(i, 0) = GetIni("TVPara.ini", "视频" & i, "IP地址", 0)
            ChannelPara(i, 1) = GetIni("TVPara.ini", "视频" & i, "通道号", 0)
            ChannelPara(i, 2) = GetIni("TVPara.ini", "视频" & i, "安装地点", 0)
            ChannelPara(i, 3) = i
        
        
            Set Item = frmPlayPara.ListPlayPara.ListItems.Add(, , i)
                    Item.SubItems(1) = ChannelPara(i, 2)
                    Item.SubItems(2) = ChannelPara(i, 1)
                    Item.SubItems(3) = ChannelPara(i, 0)
         Next i
         frmPlayPara.left = PicVideo(Index).left
         frmPlayPara.top = PicVideo(Index).top
         frmPlayPara.Show
         
End Sub

Sub port()

    For i = 0 To 15
          If ifRecord(i) Then
             stockhandle(i) = Cli_PlaySoft(PicVideo(j).hwnd, Channel(i, 1), m_linktype, IPAddress, UserName, UserPassword, 1)
             j = j + 1
          End If
    Next i
End Sub

Private Sub Timer1_Timer()
        Timer1.Enabled = False
            labCurDate.Caption = Year(Date) & "/" & Month(Date) & "/" & Day(Date)
            labTime.Caption = Format(Time, "hh:mm:ss")
        Timer1.Enabled = True
End Sub

Private Sub Switch1_Timer()
    
         Switch1.Enabled = False
         
         iNext = iNext + 1
         
         If iNext >= 16 Then
             iNext = 1
         End If
        
         Label3.Caption = "页码" & iNext
         LargeWindow iNext
         
         Switch1.Enabled = True
 
End Sub


' 选择画面显示方式
Private Sub tbrShowControl_ButtonClick(ByVal Button As MSComctlLib.Button)

    Dim i As Integer
    
        
    Select Case Button.key
        Case "ONESHOW"
               
                 LargeWindow 1
                 bswitch = 1
                 
                 Num = 1
                 iNext = 0
'
        Case "FOURSHOW"             ' 4 画面, 卡数不大于4,则小显;否则小小显
               
                
                Show4Windows
                bswitch = 4
                Num = 4

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -