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

VBScript 輸出中的對齊實(shí)現(xiàn)方法

 更新時(shí)間:2013年09月01日 18:26:15   作者:  
有時(shí)候我們需要在vbs中輸入的字符實(shí)現(xiàn)對齊效果,那么就可以參考下面的代碼了
運(yùn)行效果:



代碼(fOutput.vbs):

復(fù)制代碼 代碼如下:

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

相關(guān)文章

最新評論