일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
- check_password
- tkinter Radio 동적버튼
- flask
- Django-allauth
- FastAPI
- SQL
- numpy
- Django
- GraphQL
- array
- python
- for loop
- graphene-django
- allauth
- Today
- Total
객
[ VB.NET ] OpenFileDialog 예제 본문
Imports System
Imports System.IO
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim txtNamePath As String
Dim txtName As String
Dim FileName As String
OpenFileDialog1.Filter = "Text Files|*.txt"
OpenFileDialog1.Title = "Text Read 예제"
If OpenFileDialog1.ShowDialog() = DialogResult.OK Then
txtNamePath = OpenFileDialog1.FileName
RichTextBox1.Text = ""
If txtNamePath <> "" Then
Try
FileOpen(1, OpenFileDialog1.FileName, OpenMode.Input)
Do Until EOF(1)
txtName = LineInput(1)
RichTextBox1.Text = RichTextBox1.Text & txtName & vbCrLf
Loop
Catch
MsgBox("Error opening file")
Finally
FileClose(1)
End Try
End If
Label1.Text = txtNamePath
FileName = Mid(txtNamePath, InStrRev(txtNamePath, "\") + 1)
Me.Text = " [ " & "TEXTBOX예제 - " & FileName & " ]"
End If
End Sub
'=========================================================================================================
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Text = "TEXTBOX예제"
Label1.Text = ""
Button1.Text = "Read"
Button2.Text = "Exit"
End Sub
'==========================================================================================================
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Me.Close()
End
End Sub
End Class
'[PL] > VB & VB.NET' 카테고리의 다른 글
[ vb 2008 ] 사용자 컨트롤 매핑 (0) | 2009.12.31 |
---|---|
[ vb 2008 ] ListView 예제. (0) | 2009.12.30 |
[vb 2008]Try Catch 정리 (0) | 2009.12.24 |
시계예제 (0) | 2008.07.28 |
[vb.net 2005] 날자 및 시간 예제 (0) | 2008.07.27 |