- 听众
- 收听
- 积分
- 2462
- 主题
- 回帖
- 0
- 精华
注册时间2006-9-30
最后登录1970-1-1
该用户从未签到
|
前几天下了个VBScropt帮助手册,写出来的东东
处女作
功能...看完就知道
'Coded by newbie
Private Function td(ByVal Color, ByVal Font, ByVal MapName, ByVal URL, ByVal withURL)
If withURL = 0 Then
td = "[td][color=" & Color & "]" & MapName & "[/td]"
Else
td = "[td][color=" & Color & "]" & MapName & "[/td]"
End If
End Function
Dim fso, Table, DiscuzCode
Set fso = CreateObject("Scripting.FileSystemObject")
If (fso.FileExists("table.txt")) Then
Dim Columns
Dim strCode, strTemp1, strTemp2, strTrCode
Dim Counter
Counter = 0
strCode = ""
strTrCode = ""
Columns = InputBox("请输入列数")
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Set Table = fso.OpenTextFile("table.txt", ForReading)
Do While Table.AtEndOfLine <> True
Counter = Counter + 1
strTemp1 = Table.ReadLine
strTemp2 = Table.ReadLine
If Len(Trim(strTemp2)) = 0 Then
strTrCode = strTrCode & td("#0033bb", "Arial", strTemp1, "", 0)
Else
strTrCode = strTrCode & td("#0033bb", "Arial", strTemp1, strTemp2, 1)
End If
If Counter = CInt(Columns) Then
Counter = 0
strCode = strCode & "" & strTrCode & ""
strTrCode = ""
End If
Loop
Table.Close
If Counter <> 0 Then strCode = strCode & "" & strTrCode & ""
Set DiscuzCode = fso.OpenTextFile("DiscuzCode.txt", ForWriting, True)
strCode = strCode & ""
DiscuzCode.Write strCode
DiscuzCode.Close
Else
MsgBox "table.txt 不存在"
End If |
|