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) '寫入文字檔

 

 

arrow
arrow
    全站熱搜

    Error001 發表在 痞客邦 留言(0) 人氣()