VBScript 输出中的对齐实现方法
代码(fOutput.vbs):
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery( _
"SELECT * FROM Win32_NetworkAdapterConfiguration",,48)
For Each objItem in colItems
Wscript.Echo objItem.Caption & fOutput(objItem.Caption) & "textinfo"
Next
Function fOutput(strName)
strLen = Len(strName)
Select Case True
Case strLen < 8
fOutput = chr(9) & chr(9) & chr(9) & chr(9) & chr(9)
Case strLen < 16
fOutput = chr(9) & chr(9) & chr(9) & chr(9)
Case strLen < 24
fOutput = chr(9) & chr(9) & chr(9)
Case strLen < 32
fOutput = chr(9) & chr(9)
Case strLen < 40
fOutput = chr(9)
Case Else
'超过40的只取前32位
For K = 1 To strLen - 32
fOutput = fOutput & chr(8)
Next
fOutput = fOutput & " ..." & chr(9)
End Select
End Function
原文:https://www.enun.net/?p=2381
相关文章
VBS教程:VBScript 语句-Property Let 语句
VBS教程:VBScript 语句-Property Let 语句...2006-11-11抖音vbs表白代码大全 抖音vbscript表白代码使用方法
抖音vbs表白代码大全分享,最近很多小伙伴都在抖音上看到了一个vbs表白代码这个玩法,感觉非常的有趣。不过不少玩家还不知道怎么弄的,下面就来一起看下制作方法吧2018-07-07
最新评论