Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim name As String
OpenFileDialog1.Filter = ""
OpenFileDialog1.FilterIndex = 2
On Error GoTo err
OpenFileDialog1.ShowDialog()
OpenFileDialog1.FileName = OpenFileDialog1.FileName
FileOpen(3, OpenFileDialog1.FileName, OpenMode.Input)
Do While Not EOF(3)
name = LineInput(3)
If Len(Trim(name)) > 0 Then
ListBox1.Items.Add(Trim(name))
End If
Loop
FileClose(3)
Exit Sub
err:
Exit Sub
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim name As String Dim i As Double OpenFileDialog1.InitialDirectory = "c:\" OpenFileDialog1.Filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*" OpenFileDialog1.FilterIndex = 2 OpenFileDialog1.RestoreDirectory = True On Error GoTo err OpenFileDialog1.ShowDialog() OpenFileDialog1.FileName = OpenFileDialog1.FileName FileOpen(3, OpenFileDialog1.FileName, OpenMode.Input) Do While Not EOF(3) name = LineInput(3) If Len(Trim(name)) > 0 Then ListBox1.Items.Add(Trim(name)) For i = 0 To 1000 Label1.Text = i Next End If
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim name As String
Dim i As Double
OpenFileDialog1.InitialDirectory = "c:\"
OpenFileDialog1.Filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*"
OpenFileDialog1.FilterIndex = 2
OpenFileDialog1.RestoreDirectory = True
On Error GoTo err
OpenFileDialog1.ShowDialog()
OpenFileDialog1.FileName = OpenFileDialog1.FileName
FileOpen(3, OpenFileDialog1.FileName, OpenMode.Input)
Do While Not EOF(3)
name = LineInput(3)
If Len(Trim(name)) > 0 Then
ListBox1.Items.Add(Trim(name))
For i = 0 To 1000
Label1.Text = i
Next
End If
Loop
FileClose(3)
Exit Sub
err:
Exit Sub
End Sub
End Class
이 댓글을