综艺节目脚本怎么写这本书样
注意,网卡地址将在一信息框中显示出来' FileName: SoftwareMeteringCLS.vbs ' //////////////////////////////////////////////////////////////////// If (WScript.ScriptName="SoftwareMeteringCLS.vbs") Then Call demo_SoftwareMeteringCLS() '====================================================================Function getSoftwareList(sHost) ' Callable by *.wsf; will return list (safe array) of installed ' software on the sHost system (sHost is ComputerName or IP address). ' ' The assumption is that sHost is available and has WMI installed. Set oSoftMeter=new SoftwareMeteringCLS sProgsAry=oSoftMeter.getList(sHost) Set oSpftMeter=Nothing getSoftwareList=sProgsAry End Function '======================CLASS=======================================Class SoftwareMeteringCLS ' Author: Branimir Petrovic ' Date: 6 Sept 2002 ' Version: 1.0.3 ' ' Revision History: ' 30 March 2002 V 1.0.0 ' ' 08 April 2002 V 1.0.1 ' Added error handling - if the target system is not present, ' or does not have WMI, getList(sHost) will return empty list. ' ' Added global function getSoftwareList(sHost) to be used ' from *.wsf scripts when caller script is JScript (since ' JScript can not instantiate VBS classes directly). ' ' 21 April 2002 V 1.0.2 ' Replacing "[" with "(" and "]" with ")" in "DisplayName" ' Some strings like: [See Q311401 for more information] ' can cause troubles, therefore replacement. ' ' 6 Sept 2002 V 1.0.3 ' Win2K's SP3 for Windows 2000 introduced slight (but silent) ' 'improvement' in a way registry provder's EnumValues method ' deals with empty keys. EnumValues method called against ' keys without any values (except the Default, empty value) ' will now return Null value (previously array of size 0 was ' returned). Added (previously unneeded) type checking... ' ' ' Dependancies: ' WSH 5.6 ' ' Methods: ' - getClassName() ' - getVersion() ' - getList(sHost) sHost parameter can be computer name or IP address ' Enumerates all subkeys in: ' "Software\Microsoft\Windows\CurrentVersion\Uninstall" ' Returns array of strings, each string item containing: ' "DisplayNameKeyValue[ --Version: DisplayVersionKeyValue]" ' ' If sHost parameter is empty string or non-string value, ' function returns list of installed software on this host. ' Otherwise it will connect to host pointed to by sHost string ' (provided sufficient level of permissions) ' ' - getHostString() Returns name of the system or IP address ' --- Private data members Private HKLM ' Points to HKEY_LOCAL_MACHINE hive Private UNINSTALL_ROOT ' Software\Microsoft\Windows\CurrentVersion\Uninstall Private SUPRESS_HOTFIX_ENTRIES ' By default is TRUE (set in Class_Initialize) ' (supressess listing of installed hotfixes) Private CLASS_NAME Private VERSION Private REG_SZ Private oReg Private sComputerName ' --- Public Public Function getClassName() getClassName=CLASS_NAME End Function Public Function getVersion() getVersion=VERSION End Function Public Function getList(sHost) If TypeName(sHost)="String" AND sHost<>"" Then sComputerName=sHost Else sComputerName=WScript.CreateObject("WScript.Network").ComputerName End If On Error Resume Next Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}//" &_ sComputerName & "/root/default:StdRegProv") If Err.Number<>0 Then ' Computer is not accessable or does not have WMI, return empty array getList=Array() Else ' Computer is on the network and does have working WMI, ' return the list (safe array) of installed software getList=listInstalledProgs(oReg) End If On Error GoTo 0 End Function Public Function getHostString() getHostString=sComputerName End Function ' --- Private helper routines Private Sub Class_Initialize ' Initialize various values used by this class HKLM=&H80000002 ' Hive: HKEY_LOCAL_MACHINE UNINSTALL_ROOT="Software\Microsoft\Windows\CurrentVersion\Uninstall" REG_SZ=1 SUPRESS_HOTFIX_ENTRIES=true CLASS_NAME="SoftwareMeteringCLS" VERSION="1.0.3" End Sub Private Function listInstalledProgs(oReg) ' returns array of strings DisplayName & " " & DisplayVersion Dim oRegX, nCnt, sSubKeysAry, sProgName Dim sProgsAry(): ReDim sProgsAry(1) sSubKeysAry=getKeys(oReg, HKLM, UNINSTALL_ROOT) If SUPRESS_HOTFIX_ENTRIES Then ' Supress looking into all hot fix related sub keys (like Q252795, etc...) Set oRegX=new RegExp oRegX.Pattern="^Q\d+$" ' will detect patterns like: Q252795 oRegX.IgnoreCase=true For nCnt=0 To UBound(sSubKeysAry) If NOT oRegX.Test(sSubKeysAry(nCnt)) Then sProgName=getProgNameAndVersion(oReg, HKLM, _ UNINSTALL_ROOT & "" & sSubKeysAry(nCnt)) If NOT (IsEmpty(sProgName) OR sProgName="") Then If NOT IsEmpty(sProgsAry(UBound(sProgsAry) - 1)) Then ReDim Preserve sProgsAry(UBound(sProgsAry)+1) End If sProgsAry(UBound(sProgsAry)-1)=sProgName End If End If Next Else ' List all sub keys including hotfix related ones (like Q252795, etc...) For nCnt=0 To UBound(sSubKeysAry) sProgName=getProgNameAndVersion(oReg, HKLM, _ UNINSTALL_ROOT & "" & sSubKeysAry(nCnt)) If NOT (IsEmpty(sProgName) OR sProgName="") Then If NOT IsEmpty(sProgsAry(UBound(sProgsAry) - 1)) Then ReDim Preserve sProgsAry(UBound(sProgsAry)+1) End If sProgsAry(UBound(sProgsAry)-1)=sProgName End If Next End If listInstalledProgs=sProgsAry End Function Private Function getKeys(oReg, HIVE, sKeyRoot) ' Returns array of strings of subkey names Dim vKeysAry Call oReg.EnumKey(HIVE, sKeyRoot, vKeysAry) getKeys=vKeysAry ' >>> End Function Private Function getProgNameAndVersion(oReg, HIVE, sKeyRoot) ' If both values "DisplayName" and "DisplayVersion" exist in sKeyRoot, return: ' "DisplayNameKeyValue --Version: DisplayVersionKeyValue" ' ' If only "DisplayName" exists, return: ' "DisplayNameKeyValue" ' ' Otherwise EMPTY is returned Dim sKeyValuesAry, iKeyTypesAry, nCnt, sValue, sDisplayName, sDisplayVersion oReg.EnumValues HIVE, sKeyRoot, sKeyValuesAry, iKeyTypesAry 'fill the arrays ' 6 Sept 2002 ' SP3 for Win2K altered behavior of registry provider's EnumValues method! ' EnumValues method after SP3 does not return empty array any more for all ' those registry keys that have only empty Default value. ' Therefore sKeyValuesAry must be tested to see if it is an array or not. If NOT IsArray(sKeyValuesAry) Then Exit Function ' ' >>> End If For nCnt=0 To UBound(sKeyValuesAry) If InStr(1, sKeyValuesAry(nCnt), "DisplayName", vbTextCompare) Then If iKeyTypesAry(nCnt)=REG_SZ Then oReg.GetStringValue HIVE, sKeyRoot, sKeyValuesAry(nCnt), sValue If sValue<>"" Then sDisplayName=sValue sDisplayName=Replace(sDisplayName, "[", "(") sDisplayName=Replace(sDisplayName, "]", ")") End If End If ElseIf InStr(1, sKeyValuesAry(nCnt), "DisplayVersion", vbTextCompare) Then If iKeyTypesAry(nCnt)=REG_SZ Then oReg.GetStringValue HIVE, sKeyRoot, sKeyValuesAry(nCnt), sValue If sValue<>"" Then sDisplayVersion=sValue End If End If If (sDisplayName<>"") AND (sDisplayVersion<>"") Then getProgNameAndVersion=sDisplayName & " --Version: " & sDisplayVersion Exit Function ' >>> End If Next If sDisplayName<>"" Then getProgNameAndVersion=sDisplayName Exit Function ' >>> End If End Function End Class '======================END OF CLASS================================Function demo_SoftwareMeteringCLS() Dim oSoftMeter, sProgsAry, sComputer 'sComputer="W-BRANIMIR-666" 'sComputer="W-Branimir-079" sComputer="" ' query local host sProgsAry=getSoftwareList(sComputer) Call WScript.Echo(Join(sProgsAry, vbCrLf)) End Function

WSH 为宿主脚本创建环境 2、转换编辑版本为打印版本: 遍历这个文档,修改SelIndent和SelRightIndent的数值,使之适合于打印机(注意:编辑时的缩进数值对于屏幕是合适的,但不适用于打印机)
他正坐在那儿,努力思考将姓限制为10个字符的方法,正在这时--天哪;今天的时间到了笔者用VB6.0通过调用API函数设计应用系统的ABOUT窗口
''owc.vbs class owc private o '传入物件 public property set set_obj(o_id) set o=o_id end property '画图矩形图 'chart_bgcolor_图表的背景颜色 'chartCaption_图表的标题 'chartCaption_fontColor_图表标题颜色 'Interior_Color_矩形内的填充颜色 'Caption_名称 'categories_名称数组 'values_值数组串 public sub bar(chart_bgcolor_,chartCaption_,chartCaption_fontColor_,Interior_Color_,Caption_,categories_,values_) o.Clear set cht=o.Charts.Add set c=o.Constants cht.Type=c.chChartTypeColumnClustered '设背景色或是填充 o.Charts(0).PlotArea.Interior.SetSolid chart_bgcolor_ '加上图表的标题 o.HasChartSpaceTitle=True set cst=o.ChartSpaceTitle cst.Caption=chartCaption_ cst.Font.Color=chartCaption_fontColor_ cst.Font.Italic=False cst.Font.Name="Arial" cst.Font.Size=12 cst.Font.Underline=c.owcUnderlineStyleSingle '添加数据 cht.SetData c.chDimCategories, c.chDataLiteral, categories_ cht.SeriesCollection(0).SetData c.chDimValues, c.chDataLiteral, values_ '直条的背景色进行设定 set sc=o.Charts(0).SeriesCollection(0) sc.Interior.Color=Interior_Color_ '直条上的显示设置 sc.Caption=Caption_ set dl=cht.SeriesCollection(0).DataLabelsCollection.Add dl.HasValue=True dl.HasPercentage=False dl.Font.Size=9 dl.Font.Color="red" dl.Position=c.chLegendPositionRight dl.NumberFormat="00.00%" '左边百分比的属性设置 Set cta=cht.Axes(c.chAxisPositionLeft) cta.Font.Size=9 cta.NumberFormat="0.0%" cta.MajorUnit=0.1 end sub '多系列矩形图 'chart_bgColor_图表的背景颜色 'chartCaption_图表的标题 'chartCaption_fontColor_图表标题颜色 'color_颜色数组 'caption_名称数组 'categories_名称数组 'values_值数组 public sub serBar(chart_bgColor_,chartCaption_,chartCaption_fontColor_,color_,caption_,categories_,values_) o.Clear o.Charts.Add Set c=o.Constants '图表的类型 o.Charts(0).type=c.chChartTypeColumnClustered '给绘图区加背景色 o.Charts(0).PlotArea.Interior.SetSolid chart_bgColor_ ''加上图表的标题 o.HasChartSpaceTitle=True o.ChartSpaceTitle.Caption=chartCaption_ '标题的属性 o.ChartSpaceTitle.Font.Color=chartCaption_fontColor_ o.ChartSpaceTitle.Font.Italic=False o.ChartSpaceTitle.Font.Name="Arial" o.ChartSpaceTitle.Font.Size=12 o.ChartSpaceTitle.Font.Underline=c.owcUnderlineStyleSingle '用循环来新增SeriesCollection以及里面的内容 for i=0 to ubound(caption_) valuetemp="" for j=i*(ubound(categories_)+1) to (i+1)*(ubound(categories_)+1)-1 valuetemp=valuetemp & "," & values_(j) next valuearr=split(mid(valuetemp,2),",") o.Charts(0).SeriesCollection.Add o.Charts(0).SeriesCollection(i).Caption=caption_(i) o.Charts(0).SeriesCollection(i).Interior.Color=color_(i) o.Charts(0).SeriesCollection(i).SetData c.chDimCategories, c.chDataLiteral, categories_ o.Charts(0).SeriesCollection(i).SetData c.chDimValues, c.chDataLiteral, valuearr set dl=o.Charts(0).SeriesCollection(i).DataLabelsCollection.Add dl.HasValue=True dl.HasPercentage=False dl.Font.Size=9 dl.Font.Color="red" dl.Position=c.chLegendPositionRight dl.NumberFormat="00.00%" next ''图例的设定 o.Charts(0).HasLegend=True o.Charts(0).Legend.Font.Size=9 o.Charts(0).Legend.Position=c.chLegendPositionBottom ''左边百分比的属性设置 Set cta=o.Charts(0).Axes(c.chAxisPositionLeft) cta.Font.Size=9 cta.NumberFormat="0.00%" cta.MajorUnit=0.1 end sub '画圆饼图 'chart_bgColor_绘图区加背景色 'chartCaption_图表的标题 'chartCaption_fontColor_图表标题颜色 public sub Pie(chart_bgColor_,chartCaption_,chartCaption_fontColor_,Caption_,categories_,values_) o.Clear Set cht=o.Charts.Add Set c=o.Constants cht.Type=c.chChartTypePie3d '给绘图区加背景色 o.Charts(0).PlotArea.Interior.SetSolid chart_bgColor_ cht.ExtrudeAngle=90 cht.ChartDepth=169 cht.AspectRatio=120 cht.Rotation=180 cht.Inclination=70 o.HasChartSpaceTitle=True o.ChartSpaceTitle.Caption=chartCaption_ o.ChartSpaceTitle.Font.Color=chartCaption_fontColor_ o.ChartSpaceTitle.Font.Name="Arial" o.ChartSpaceTitle.Font.Size=12 o.ChartSpaceTitle.Font.Underline=c.owcUnderlineStyleSingle cht.HasLegend=True cht.Legend.Font.Size=9 cht.Legend.Position=c.chLegendPositionBottom cht.SetData c.chDimCategories, c.chDataLiteral, categories_ cht.SeriesCollection(0).SetData c.chDimValues, c.chDataLiteral, values_ set sc=o.Charts(0).SeriesCollection(0) sc.Caption=Caption_ Set dl=cht.SeriesCollection(0).DataLabelsCollection.Add dl.Separator=":" dl.HasValue=false dl.HasSeriesName=false dl.HasCategoryName=true dl.HasPercentage=true dl.Font.Size=9 dl.Font.Color="red" dl.NumberFormat="00.00%" end sub '拆线图 'chart_bgColor_绘图区加背景色 'chartCaption_图表的标题 'chartCaption_fontColor_图表标题颜色 public sub line(chart_bgColor_,chartCaption_,chartCaption_fontColor_,Caption_,categories_,values_) o.Clear Set cht=o.Charts.Add Set c=o.Constants cht.Type=c.chChartTypeLineMarkers '给绘图区加背景色 o.Charts(0).PlotArea.Interior.SetSolid chart_bgColor_ o.HasChartSpaceTitle=True o.ChartSpaceTitle.Caption=chartCaption_ o.ChartSpaceTitle.Font.Color=chartCaption_fontColor_ o.ChartSpaceTitle.Font.Name="Arial" o.ChartSpaceTitle.Font.Size=12 o.ChartSpaceTitle.Font.Underline=c.owcUnderlineStyleSingle cht.SetData c.chDimCategories, c.chDataLiteral, categories_ cht.SeriesCollection(0).SetData c.chDimValues, c.chDataLiteral, values_ set sc=o.Charts(0).SeriesCollection(0) sc.Caption=Caption_ Set dl=cht.SeriesCollection(0).DataLabelsCollection.Add dl.HasValue=True dl.HasPercentage=False dl.Font.Size=9 dl.Font.Color="red" Set categoryAxis=cht.Axes(c.chAxisPositionBottom) categoryAxis.Font.Size=9 Set categoryAxis=cht.Axes(c.chAxisPositionLeft) categoryAxis.Font.Size=9 end sub '多系列拆线图 'chart_bgColor_图表的背景颜色 'chartCaption_图表的标题 'chartCaption_fontColor_图表标题颜色 'color_颜色数组 'caption_名称数组 'categories_名称数组 'values_值数组 public sub serLine(chart_bgColor_,chartCaption_,chartCaption_fontColor_,color_,SeriesNames_,categories_,values_) o.Clear Set cht=o.Charts.Add Set c=o.Constants '设置图表类型 cht.Type=c.chChartTypeLineMarkers '给绘图区加背景色 o.Charts(0).PlotArea.Interior.Color=chart_bgColor_ '加上标题 o.HasChartSpaceTitle=True o.ChartSpaceTitle.Caption=chartCaption_ o.ChartSpaceTitle.Font.Color=chartCaption_fontColor_ o.ChartSpaceTitle.Font.Name="Arial" o.ChartSpaceTitle.Font.Size=12 ''添加数据 cht.SetData c.chDimSeriesNames, c.chDataLiteral, SeriesNames_ cht.SetData c.chDimCategories, c.chDataLiteral, Categories_ set categoryAxis=cht.Axes(c.chAxisPositionBottom) categoryAxis.Font.Size=9 Set categoryAxis=cht.Axes(c.chAxisPositionLeft) categoryAxis.Font.Size=9 for i=0 to ubound(SeriesNames_) valuetemp="" for j=i*(ubound(Categories_)+1) to (i+1)*(ubound(Categories_)+1)-1 valuetemp=valuetemp & "," & values_(j) next valuearr=split(mid(valuetemp,2),",") cht.SeriesCollection(i).SetData c.chDimValues, c.chDataLiteral, valuearr cht.SeriesCollection(i).Line.Color=color_(i) cht.SeriesCollection(i).Line.Weight=c.owcLineWeightThin cht.SeriesCollection(i).Marker.Style=c.chMarkerStyleDiamond cht.SeriesCollection(i).Interior.Color=color_(i) Set dl=cht.SeriesCollection(i).DataLabelsCollection.Add dl.HasValue=true dl.HasPercentage=false dl.Font.Size=9 dl.font.color="red" next end sub '清除图型 public sub clear() o.Clear end sub end class 钢琴编PublicDeclareFunctionGetDesktopWindowLib"user32"()AsLongPublicDeclareFunctionGetDCLib"user32"(ByValhwndAsLong)AsLongPublicDeclareFunctionBitBltLib"gdi32"_(ByValhDestDCAsLong,_ByValxAsLong,_ByValyAsLong,_ByValnWidthAsLong,_ByValnHeightAsLong,_ByValhSrcDCAsLong,_ByValxSrcAsLong,_ByValySrcAsLong,_ByValdwRopAsLong)AsLongPrivateSubForm_Load()DimlDesktopAsLongDimlDCAsLongForm1.AutoRedraw=TrueForm1.ScaleMode=1lDesktop=GetDesktopWindow()'取得桌面窗口lDC=GetDC(lDesktop)'取得桌面窗口的设备场景BitBltMe.hDC,0,0,Screen.Width,Screen.Height,lDC,0,0,vbSrcCopy'将桌面图象绘制到窗体EndSub->
Dim uMaMe Do While (strReturn <> "我是猪") '循环语句,直到变量 strReturn 等于 “我是猪” 时退出循环。