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

📄 vbterm.frm

📁 某公司的电话录音程序
💻 FRM
📖 第 1 页 / 共 3 页
字号:
   End
   Begin VB.Menu menu_Query 
      Caption         =   "查询"
   End
   Begin VB.Menu menu_SetUp 
      Caption         =   "设置"
      Begin VB.Menu userinfo 
         Caption         =   "用户管理"
      End
      Begin VB.Menu changepass 
         Caption         =   "修改密码"
      End
      Begin VB.Menu setup 
         Caption         =   "设置"
      End
   End
   Begin VB.Menu Menu_swich 
      Caption         =   "界面切换"
   End
   Begin VB.Menu mnuPort 
      Caption         =   "通信端口"
      Enabled         =   0   'False
      Visible         =   0   'False
      Begin VB.Menu mnuOpen 
         Caption         =   "打开端口"
      End
      Begin VB.Menu MBar1 
         Caption         =   "-"
      End
      Begin VB.Menu mnuProperties 
         Caption         =   "属性"
      End
   End
   Begin VB.Menu mnuexit 
      Caption         =   "退出"
   End
End
Attribute VB_Name = "frmTerminal"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
  Dim sFile As String
  Dim ik, Oldstr As String
  Dim ip As String
  Dim opentext As Variant
  Dim MaxChannels As Integer
  Dim Filename As String
  Dim tt As Integer
  Dim RunStatus As String
  Dim Channel As Long
  Dim ChannelFlag As Integer
  Dim a(), b()
    

Sub Receive()
     'Do
     '  dummy = DoEvents()
       ' 如果缓冲区中有数据,则把它读出来。
     '   SendKeys ("{down}")
     'Loop
End Sub

Private Sub changepass_Click()
MYPassword.Show
End Sub

Private Sub Command1_Click()
'Dim FileName As String
Dim testsignal As Long

  '      Filename = App.Path + "\tw\asdfasdfasdf" + mGettime + CStr(20)
        'App.Path & "tw\" + CStr(Channel) + ".tw
        '"d:\yygl\sound\" + CStr(Channel) + "\" + CStr(tt) + CStr(Date) + CStr(Time())
 '       If TV_StartRecordFile(0, Filename, 0, 1000000) = -1 Then
  '         MsgBox ("录音错误!")
  '      End If
'        TV_StopRecordFile (0)
        TV_OffHookCtrl 1
        testsignal = TV_CheckSignal(1, 2, 2)
        Text1.Text = CStr(testsignal)
        
End Sub

Private Sub Command2_Click()
'        TV_OffHookCtrl 1
        
        Text1.Text = CStr(TV_MonitorOffHook(1, 25))
 End Sub

Private Sub Command3_Click()
        TV_StartMonitor (1)

End Sub

Private Sub Command6_Click()
Dim Filename, DateAndTime As String
DateAndTime = mGettime()
Filename = App.Path + "\tw\" + DateAndTime + CStr(0) + "i" + CStr("2157250") + ".tw" 'CStr(TelephoneNumber) + ".tw"
        '"d:\yygl\sound\" + CStr(ThisChannel) + "\" + CStr(tt) + CStr(Date) + CStr(Time())
        If TV_StartRecordFile(0, Filename, 0, 300000) = -1 Then
           MsgBox ("录音错误!")
        End If
        
End Sub

Private Sub Command7_Click()
If TV_RecordFileRest(0) = 0 Then
 MsgBox ("")
 TV_StopRecordFile (0)
End If
End Sub

Private Sub Form_GotFocus()
Textbox1.Text = Textbox1.Text + LogleText
SendKeys ("^{end}")
End Sub

Private Sub Menu_AutoManage_Click()
 Menu_AutoManage.Checked = Not Menu_AutoManage.Checked
 Timer1.Enabled = Not Menu_AutoManage.Checked
 Timer2.Enabled = Menu_AutoManage.Checked
 If Menu_AutoManage.Checked Then
   sbrStatus1.Panels("status").Text = sbrStatus1.Panels("status").Text + "      无人值守"
 Else
   DisplayStatus
 End If

If Timer1.Enabled Then
  MsgBox "关闭无人值守"
End If

If Timer2.Enabled Then
  MsgBox "打开无人值守"
End If

End Sub

Private Sub Menu_dial_Click()
form_dial.Show
End Sub

Private Sub menu_PickUpSound_Click()
Dim InfoOfTran
Dim fNum As Integer
Dim mTime As String '存放格式化后的时间
Dim fs, f, f1, fc, s
Dim i As Integer
Dim j As Integer
Dim gRow, gCol As Integer
    Set fs = CreateObject("Scripting.FileSystemObject")
    Set f = fs.GetFolder(App.Path & "\tw")
    Set fc = f.Files
    For Each f1 In fc
      'If Len(Trim(f1.Name)) - NumLong <> 19 Then
        InfoOfTran = Pcm2Wave(App.Path & "\tw\" + f1.Name, App.Path & "\sound\" + Left(f1.Name, Len(f1.Name) - 2) + "wav", 0)
      'End If
        fs.movefile App.Path & "\tw\" + f1.Name, App.Path & "\twbak\" + f1.Name
    Next
If MsgBox("是否真的要进行信息处理", 289, "信息处理") = 1 Then
   fMove.Show
End If
End Sub

Private Sub menu_Query_Click()
fSearch.Show

End Sub

Private Sub menu_QueryStatus_Click()
  frmQueryStatus.Show 'vbModal
End Sub

Private Sub Menu_swich_Click()
Dim i As Integer
 For i = 0 To 8
   Command5(i).Visible = Not (Command5(i).Visible)
 Next
' Textbox1.Visible = Not Command5(1).Visible
End Sub

Private Sub setup_Click()
Form_SetUp.Show
End Sub

Private Sub Timer1_Timer()
Dim DateAndTime As String
Dim TelephoneNumber As Long
Dim ThisChannel As Integer
Dim fName As String

DateAndTime = mGettime()
TelephoneNumber = 2157250
 
 '   If TV_OffHookDetect(Channel) <> 0 And ChannelFlag = 0 Then
 'If TV_OffHookDetect(Channel) = 0 And ChannelFlag = 0 Then
For ThisChannel = 0 To 7
  'If ThisChannels(ThisChannel).CStatus = WS_HANGUP Then
    If TV_RingDetect(ThisChannel) >= 2 Then
    
fName = App.Path & "\respond\" + CStr(ThisChannel) + ".wav"
MMControl1.Command = "stop"
MMControl1.Command = "close"
MMControl1.Notify = False
MMControl1.Wait = True
'MMControl1.Shareable = False
MMControl1.DeviceType = "WaveAudio"
MMControl1.Filename = fName
MMControl1.Command = "Open"
MMControl1.Command = "Play"

MMControl1.Command = "Play"


    
        RunStatus = "响铃"
        DisplayStatus
        OutputChannels(ThisChannel) = "响铃"
        Command5(ThisChannel) = "通道: " + CStr(ThisChannel) + Chr(13) + Chr(10) + Chr(13) + Chr(10) + OutputChannels(ThisChannel)
        TelephoneNumber = TV_ReceiveCallingID(ThisChannel, idbuf, 40)
        Textbox1.Text = Textbox1.Text + DateAndTime + "    通道: " + CStr(ThisChannel) + "    来自:"
        Textbox1.Text = Textbox1.Text + CStr(TelephoneNumber) + "     " + RunStatus + Chr(13) + Chr(10) '+ Chr(13)
        SendKeys ("^{end}")
       
        TV_OffHookCtrl ThisChannel
        'idbuf = Space(60)
        'Label2.Caption = Trim(idbuf)
        Channels(ThisChannel).CStatus = WS_OFFHOOK
        Filename = App.Path + "\tw\0" + DateAndTime + CStr(ThisChannel) + "i" + CStr(TelephoneNumber) + ".tw"
        '"d:\yygl\sound\" + CStr(ThisChannel) + "\" + CStr(tt) + CStr(Date) + CStr(Time())
        If TV_StartRecordFile(ThisChannel, Filename, 0, 1000000) = -1 Then
           MsgBox ("录音错误!")
        End If
        RunStatus = "录音"
        DisplayStatus
        OutputChannels(ThisChannel) = "录音"
        Command5(ThisChannel) = "通道: " + CStr(ThisChannel) + Chr(13) + Chr(10) + Chr(13) + Chr(10) + OutputChannels(ThisChannel)
        Textbox1.Text = Textbox1.Text + DateAndTime + "    通道: " + CStr(ThisChannel) + "    来自:"
        Textbox1.Text = Textbox1.Text + CStr(TelephoneNumber) + "     " + RunStatus + Chr(13) + Chr(10) '+ Chr(13)
       ' Textbox1.Text = Textbox1.Text + DateAndTime + " 通道" + CStr(ThisChannel) + ": 来自"
       ' Textbox1.Text = Textbox1.Text + CStr(tt) + RunStatus + Chr(13) + Chr(10) '+ Chr(13)
        SendKeys ("^{end}")
    End If
       
    If OutputChannels(ThisChannel) = "录音" Then 'begin1
        If TV_MonitorBusy(ThisChannel, SIG_BUSY1, 5) <> 0 Or TV_MonitorBusy(ThisChannel, SIG_BUSY2, 5) <> 0 Then
            TV_StopRecordFile (ThisChannel)
            TV_HangUpCtrl ThisChannel
            Channels(ThisChannel).CStatus = WS_HANGUP
            RunStatus = "录音结束,挂机"
            DisplayStatus
            OutputChannels(ThisChannel) = "录音结束,挂机"
            Command5(ThisChannel) = "通道: " + CStr(ThisChannel) + Chr(13) + Chr(10) + Chr(13) + Chr(10) + OutputChannels(ThisChannel)
            Textbox1.Text = Textbox1.Text + DateAndTime + "    通道: " + CStr(ThisChannel) + "    来自:"
            Textbox1.Text = Textbox1.Text + CStr(TelephoneNumber) + "     " + RunStatus + Chr(13) + Chr(10) '+ Chr(13)
            'Textbox1.Text = Textbox1.Text + DateAndTime + " 通道" + CStr(ThisChannel) + ": 来自"
            'Textbox1.Text = Textbox1.Text + CStr(tt) + RunStatus + Chr(13) + Chr(10) + Chr(13) ' + "剩余:" + CStr(TV_RecordFileRest(0))
            SendKeys ("^{end}")
    End If
    
    End If 'for begin1
  'End If
Next ThisChannel
End Sub

'Next Channel



Private Sub Form_Load()
Dim i As Integer
Command1.Visible = False
Command2.Visible = False
Command3.Visible = False
Command4.Visible = False
  
  For i = 0 To 7
   OutputChannels(i) = "挂机"
   Command5(i).Caption = "通道: " + CStr(i) + Chr(13) + Chr(10) + Chr(13) + Chr(10) + OutputChannels(i)
  
 Next
 Command5(8).Caption = "通道: " + CStr(8) + Chr(13) + Chr(10) + Chr(13) + Chr(10) + "挂机"
  
  MaxChannels = TV_Installed()
 ' If MaxChannels <= 0 Then
   ' MsgBox "TW8VID驱动加载失败", 16, "冀东油田供电公司语音管理系统"
   ' End
  'End If
  TV_Initialize
  DisplayStatus
  ChannelFlag = 0
'限定权限
If UserType <> 0 Then '不是超级用户而是普通用户
   mnuFile.Enabled = False
   menu_Query.Enabled = False
   setup.Enabled = False
   userinfo.Enabled = False
End If
End Sub


Private Sub clear_Click()
Textbox1.Text = ""
End Sub

Private Sub copy_Click()
 SendKeys "^C", True
End Sub

Private Sub cut_Click()
 SendKeys "^X", True
End Sub


Private Sub paste_Click()
 SendKeys "^V", True
End Sub

Private Sub Form_Resize()
'Textbox1.Move 0, 0, 100, 100
Dim height1, height2, height3 As Integer
height1 = frmTerminal.ScaleHeight
height2 = sbrStatus1.Height
height3 = height1 - height2
If frmTerminal.ScaleWidth > 200 And height3 > 200 Then
  Textbox1.Move 0, 0, frmTerminal.ScaleWidth, height3
End If
End Sub

Private Sub Form_Unload(Cancel As Integer)
  TV_Disable
  Unload fMove
  Unload form_dial
  Unload Form_SetUp
  Unload frmProperties
  Unload frmQueryStatus
  Unload fSearch
  Unload fSearchRes
  Unload fSearchRes
  Unload login
  Unload myMain
  Unload Chinfo
  Unload MYPassword
  Unload Userm
  Unload frmAdduser
  Unload Me
End Sub
Private Sub mnuStopSendText_Click()
'  Timer1.Enabled = False
'  Timer2.Enabled = False
   Timer3.Enabled = False
   DisplayStatus
   mnuStopSendText.Enabled = False
   mnuSendText.Enabled = True

'  TV_Disable
End Sub

Private Sub mnuClearHis_Click()
If MsgBox("是否真的要清空历史", 289, "清空历史") = 1 Then
Dim fs, f, s
  Set fs = CreateObject("Scripting.FileSystemObject")
  Set f = fs.getfile(App.Path & "record.his")
  f.copy App.Path & "record.bak"

⌨️ 快捷键说明

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