▼ กำลังโหลดข้อมูล... ▼
แสดงความคิดเห็น
คุณสามารถแสดงความคิดเห็นกับกระทู้นี้ได้ด้วยการเข้าสู่ระบบ
กระทู้ที่คุณอาจสนใจ
เปิด Workbook หลาย Workbook ในโฟลเดอร์เดียว EXCEL VBA
Dim File_Path As String
Dim strName As String
File_Path = "D:\111"
strName = Dir(File_Path & "\" & &qu
สมาชิกหมายเลข 4740235
Visual Studio Code ขึ้นแบบนี้หมายความว่ายังไง?
PowerShell 7.2.1
Copyright (c) Microsoft Corporation.
https://aka.ms/powershell
Type 'help' to get help.
สมาชิกหมายเลข 6221826
ผมกำลังหัด เขียน/อ่าน Text file ใน Visual basic
โดยให้เปิดfile ชื่อ Text.txt แล้วเขียนคำว่า "Test Write text file"
อีก บันทัดเขียนคำว่า ""Write line 2"
แล้วปิด File
จากนั้นเปิด File ชื่อเดิมเพื่อนอ่าน 2 บันทัดที่เขียนไป มา แสดงหน้าจอ
แต่ Run ไม่ผ่าน ผมไม่รู้ว่า ผมผิดตรงไหน รบกวนผู้รู้ช่วยแก้ทีครับ
Imports System.IO
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim Filename As String = "Test.txt"
Dim Wri As StreamWriter = New StreamWriter(Filename)
Dim Rd As StreamReader = New StreamReader(Filename)
Dim line As String = Rd.ReadLine()
Wri.WriteLine("Test Write text file")
Wri.WriteLine("Write line 2")
Wri.Close()
MessageBox.Show("Write Sucessful")
line = Rd.ReadLine()
MessageBox.Show(line)
End Sub
End Class