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

📄 frmmain.frm

📁 用vb编写的计算文件的行数的小软件
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmMain 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "档案行数计算员"
   ClientHeight    =   4260
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   5985
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4260
   ScaleWidth      =   5985
   StartUpPosition =   2  '屏幕中心
   Begin VB.FileListBox File 
      Height          =   3870
      Hidden          =   -1  'True
      Left            =   1920
      MultiSelect     =   2  'Extended
      System          =   -1  'True
      TabIndex        =   4
      Top             =   120
      Width           =   2415
   End
   Begin VB.CommandButton cmdCalu 
      Caption         =   "开始计算"
      Height          =   495
      Left            =   4560
      TabIndex        =   2
      Top             =   480
      Width           =   1215
   End
   Begin VB.DriveListBox drv 
      Height          =   300
      Left            =   0
      TabIndex        =   1
      Top             =   120
      Width           =   1815
   End
   Begin VB.DirListBox dir 
      Height          =   3450
      Left            =   0
      TabIndex        =   0
      Top             =   480
      Width           =   1815
   End
   Begin VB.Label labTot 
      BorderStyle     =   1  'Fixed Single
      Caption         =   "档案总共行数"
      Height          =   1215
      Left            =   4560
      TabIndex        =   3
      Top             =   1080
      Width           =   1215
   End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub cmdCalu_Click()
    Dim hT1 As Integer, hCount As Integer, hFreeNumber As Integer
    Dim tmp As String
    
    tmp = ""
    hCount = 0
    
    For hT1 = 0 To File.ListCount - 1
        If File.Selected(hT1) = True Then
            hFreeNumber = FreeFile
            If Len(dir.Path) > 3 Then
                Open dir.Path + "\" + File.List(hT1) For Input As #hFreeNumber
            Else
                Open dir.Path + File.List(hT1) For Input As #hFreeNumber
            End If
            
            While Not EOF(hFreeNumber)
                Line Input #hFreeNumber, tmp
                hCount = hCount + 1
                If tmp = "" Then hCount = hCount - 1
            Wend
        
            Close #hFreeNumber
        End If
    Next
    MsgBox "计算完毕!"
    labTot.Caption = "档案总共行数" + Chr$(13) + Chr$(10) + Str$(hCount)
End Sub

Private Sub dir_Change()
    File.Path = dir.Path
End Sub

Private Sub drv_Change()
    dir.Path = drv.Drive
End Sub

⌨️ 快捷键说明

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