加入文本文件内的内容是 ********************
我想通过vbs使其变成
*****
*****
*****
*****
*****
并保存
vbs回车就是chr(13)&chr(10),直接chr(10)也可以,但是记事本打开不会换行,需要\r\n才会
function writeText(path,charset,text)'写文件
set ts=CreateObject("adodb.stream")
ts.mode=3'写模式
ts.type=2'文本模式
ts.open
ts.charset=charset'内容编码
ts.WriteText text,1
ts.SaveToFile path,2
ts.close:set ts=nothing
end function
dim text
text="****"&chr(13)&chr(10)&"****"&chr(13)&chr(10)&"****"&chr(13)&chr(10)&"****"&chr(13)&chr(10)&"****"
writeText "E:\t.txt","utf-8",text
msgbox "写入文件成功"
for i = 1 to 5
str = str & "*****" & vbcrlf
next