[General]
Description=̳űĸʽԶ
BeginHotkey=121
BeginHotkeyMod=0
RunOnce=0
Enable=0
[Repeat]
Type=0
Number=1
[CallBack]
OnSetup=
[Comment]
Content=ѡ.
˵.
㽫űԴ룬̳Discuz!Խ¸ʽţҪǶ﷨ɫʹű뿴ÿ.
.
ϸ˵.
   1.ʾεϵͳļԻԼθûѡ񣬽һĲļȣ.
   2.ʾڡ顱УVBScript밴ôܽһģʹУע⣬᲻ʹVBSԣ.
  3.ʾδͷβȡļеУԼͬʱļһļжһļд.
  4.ʾδļȡļ·.
  5.ʾζдINIļнűá.
.
߽ܡ.
ahfxman, 档.
.
ڡ.
20069
[Script]
//
Dim objDialog, fso
Dim fSourceName,fTargetname
Dim sLine, s, stemp1,stemp2
Dim LineLenOld, LineLenNew
Dim MyArray, i1, i, s1
Dim DirPath
//ʼ
ForReading = 1:ForWriting = 2:ForAppending=8
remColor="Green"
explainColor="Blue"
IniFileName="c:\path.ini"
//==============  ===============
Gosub ȡ·
Gosub ļ
Rem 
VBSCall MessageBox(", ллʹ")
EndScript
//============== ӳ ===============
Sub ļ
    Set objDialog = CreateObject("UserAccounts.CommonDialog")
    objDialog.Filter = "űļ|*.txt"
    objDialog.InitialDir = DirPath
    intResult = objDialog.ShowOpen
    If intResult <> 0
        Gosub ·
        Gosub 
        Gosub ʽ༭
     Else
        Goto 
     EndIf
Return ļ
Sub ·
    sTemp2 = objDialog.FileName
    MyArray = Split(sTemp2,"\",-1,1)
    i = UBound(MyArray)
    i1 = 1
    s1 = MyArray(0)
    While i1<i
        s1 = s1 & "\" & MyArray(i1)
        i1 = i1+1
     EndWhile
    s1 = s1 & "\"
    Plugin File.WriteINI("setup","·",s1,IniFileName)
Return ·
Sub ȡ·
    DirPath = "c:\"
    Plugin DirPath = File.ReadINI("setup","·",IniFileName)
Return ȡ·
Sub 
    fSourceName = objDialog.FileName
    fTargetName = Replace(fSourceName,".txt",".bak")
Return 
Sub ʽ༭
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set fSource = fso.OpenTextFile(fSourceName, ForReading, True)
    Set fTarget = fso.OpenTextFile(fTargetName, ForWriting, True)
    VBSCall MessageBox(fTarget)
    While fSource.AtEndOfStream<>true
        sLine = fSource.ReadLine()
        lineLenOld = Len(sLine)
        s=Trim(sLine)
        lineLenNew = Len(s)
        sTemp1 = Left(s,2)
        sTemp2 = Right(s,Len(s)-2)
        If s="[General]"
            s="[color=" & explainColor & "]" & s
        ElseIf s="[Script]"
            s="[/color][color=" & explainColor & "]" & s & "[/color]"
        ElseIf sTemp1="//"
            s="[color=" & remColor & "]" &s &"[/color]"
        Else
        EndIf
        s = Space(lineLenOld-lineLenNew) & s
        fTarget.WriteLine(s)
     EndWhile
    fSource.Close
    fTarget.Close
    VBSCall RunApp("Notepad " & fTargetName)
Return ʽ༭
