百度抽風(fēng),老是把吃掉行首空格,導(dǎo)致代碼沒有縮進(jìn)??梢杂靡韵路椒▉斫鉀Q:
1、在百度貼吧切換到經(jīng)典版
2、用以下腳本把代碼中的制表符和空格替換成unicode編碼格式
代碼如下:
'cscript //nologo C:\test\test.vbs C:\test\test.bat
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(WScript.Arguments(0),1,True)
strAll = objFile.ReadAll()
strTab = Replace (strAll,chr(9)," ")
strBlank = Replace (strTab," ","&#" & "160;")
Call SetClipboardText(strBlank)
Sub SetClipboardText(strText)
Set objIE = CreateObject("InternetExplorer.Application")
objIE.Navigate("about:blank")
objIE.Document.ParentWindow.ClipboardData.SetData "text", strText
objIE.Quit
End Sub
使用方法: 'cscript //nologo C:\test\test.vbs C:\test\test.bat