[VB.Net]簡易文字檔讀寫範例
Imports System.IO '程式開頭前需引用
Dim tmp, path as String
path = "c:\xxx.txt" '定義路徑
tmp = File.ReadAllText(path) '讀取文字檔
InStr(tmp, "欲搜尋之字串") '文字搜尋
tmp = tmp.Replace("原字串", "欲比對字串") '字串比對
File.WriteAllText(path, tmp) '寫入文字檔
By Error001