欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

用VBS將一篇txt后綴的內(nèi)容保存為html格式

 更新時(shí)間:2011年01月11日 00:44:48   作者:  
把txt文件托放到這個(gè)vbs上試一下,它會自動生成一個(gè)htm文件。需要修的地方說一下。
do.vbs
復(fù)制代碼 代碼如下:

'BY Coo_boi
If WScript.Arguments.Count=0 Then WScript.Quit
Dim fso,txt,htm
txt=WScript.Arguments(0)
Set fso=CreateObject("Scripting.FileSystemObject")
Set htm=fso.CreateTextFile(txt&".htm",True)
title=fso.GetFile(txt).Name
title=Left(title,Len(title)-4)
MsgBox title
htm.WriteLine "<html>"
htm.WriteLine "<head>"
htm.WriteLine "<title>"&title&"</title>"
htm.WriteLine "</head>"
htm.WriteLine "<body>"
htm.WriteLine "<h1 align=center>"&title&"</h1>"
htm.WriteLine "<hr color=red>"
For Each line In Split(fso.OpenTextFile(txt).ReadAll ,vbCrLf)
htm.WriteLine line&"<br>"
Next
htm.WriteLine "</body>"
htm.WriteLine "</html>"
htm.Close
WScript.Echo "將txt轉(zhuǎn)換為html成功"

將上面的代碼保存為do.vbs,然后將1.txt托動到do.vbs上。即可將txt的內(nèi)容生成為html格式,并且有換行效果。

相關(guān)文章

最新評論