VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "form1"
   ClientHeight    =   3690
   ClientLeft      =   945
   ClientTop       =   2220
   ClientWidth     =   7065
   BeginProperty Font 
      Name            =   "MS Sans Serif"
      Size            =   12
      Charset         =   0
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   LinkTopic       =   "Form1"
   PaletteMode     =   1  'UseZOrder
   ScaleHeight     =   3690
   ScaleWidth      =   7065
   Begin VB.TextBox Text2 
      Height          =   3015
      Left            =   4440
      MultiLine       =   -1  'True
      ScrollBars      =   3  'Both
      TabIndex        =   6
      Top             =   600
      Width           =   2535
   End
   Begin VB.TextBox Text1 
      Height          =   420
      Left            =   1800
      TabIndex        =   4
      Text            =   " "
      Top             =   120
      Width           =   3615
   End
   Begin VB.FileListBox File1 
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   2970
      Left            =   2280
      Pattern         =   "*.txt"
      TabIndex        =   2
      Top             =   600
      Width           =   1935
   End
   Begin VB.DirListBox Dir1 
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   2520
      Left            =   0
      TabIndex        =   1
      Top             =   1080
      Width           =   2175
   End
   Begin VB.DriveListBox Drive1 
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   360
      Left            =   0
      TabIndex        =   0
      Top             =   600
      Width           =   2055
   End
   Begin VB.Label Label1 
      Caption         =   "文件名"
      Height          =   495
      Left            =   600
      TabIndex        =   5
      Top             =   120
      Width           =   1215
   End
   Begin VB.Label lblpath 
      Height          =   495
      Left            =   2280
      TabIndex        =   3
      Top             =   480
      Width           =   2055
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub File1_DblClick()
    Dim fname$, st$, i%
    If Right(File1.Path, 1) = "\" Then ' 表示选定的是根目录
      fname = File1.Path + File1.FileName
    Else                            ' 表示选定的是子目录，子目录与文件名之间加"\"
      fname = File1.Path + "\" + File1.FileName
    End If
    i = Shell("C:\WINNT\system32\notepad.exe" + " " + fname, 1)
End Sub

Private Sub Form_Load()
    File1.Pattern = "*.txt"
End Sub

Private Sub Drive1_Change()
    Dir1.Path = Drive1.Drive
End Sub

Private Sub Dir1_Change()
    File1.Path = Dir1.Path
 End Sub

Private Sub File1_click()
    Dim fname$, st$
    If Right(File1.Path, 1) = "\" Then ' 表示选定的是根目录
      fname = File1.Path + File1.FileName
    Else                            ' 表示选定的是子目录，子目录与文件名之间加"\"
      fname = File1.Path + "\" + File1.FileName
    End If
    Text1 = fname
    Text2 = ""
    Open fname For Input As #1
    Do While Not EOF(1)
      Line Input #1, st
      Text2 = Text2 & st & vbCrLf
    Loop
    Close #1
End Sub






