網路教學(e-Learning)校園社群(e-Community)服務台(e-Service)系所班網(e-Class)登入
[VB.Net]簡易文字檔讀寫範例
by 鄭清旺 2012-12-16 14:25:23, 回應(0), 人氣(5938)
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

http://error001.pixnet.net/blog/post/75565438