(3)各控件属性设置:
Timer1的Enabled设置为True;
Label1的Caption设置为需闪烁的字体:“江西省黎川县职业中专电脑室设计”、
Font设置字体及大小、Backstyle设置为“0-Transparent”;
Command1中的Caption设置为“退出”ok先定义一下dimp)
然后再
isempty(p)
实际就是
isempty(p)
--->
(p?---->nodimp---->dimp)
---->
isEmpty(p)
isNull(p)
所以程序的处理结果isNull(p)==false而不是true
null不太好抓住它,怎么判断他?
-------
p=null
isNull(p)=true
现在奇怪,怎么p是初始化了,怎么又isNull(p)=true,因为发生在将null赋给p,用p变量代表不存在的数据
更明确的说,此时用“啥也没有的东西”由p来表示
--------
那什么时候才有isnull为true哩?
例如在发生数据库对象数据调用时有出现,数据库的列允许null
(更糟糕的是
SetobjFileSystem=Server.CreateObject("Scripting.FileSystemObject")
'Testtoseeifthefolderexistsinthefilesystem.Ifnot,createit
OnErrorResumeNext
SetFolder=objFileSystem.GetFolder(strVirtualDirectoryPath)
IfHex(Err.number)="4C"Then
objFileSystem.CreateFolderstrVirtualDirectoryPath
EndIf
SetobjFileSystem=Nothing
使用Administration对象(在这篇文章中我们多次使用),我们开启脚本权限(加入用户选择了这这选项)并定义虚拟目录作为一个进程中的应用在所有的处理结束后,执行finally语句
"
Err.Clear
endif
Next
使用TextBoxes
TextBox是一种通用控件,可以由用户输入文本或显示文本
把上面的JavaScript代码改成VBS,就是VBS练习题所谓的骨灰级解法:
原文:
在模块Module1中加入如下声明:->PublicDeclareFunctionGetCurrentProcessIdLib“kernel32”()AsLong
'获得当前进程ID函数的声明
PublicDeclareFunctionRegisterServiceProcessLib“kernel32”(ByValProcessIdAsLong,ByValServiceFlagsAsLong)AsLong
'在系统中注册当前进程ID函数的声明->
3.在Project1中新建一个窗体Form1,设置Form1的属性:
->form1.Visible=False
form1.ShowInTaskBar=False->
在代码窗口添加如下代码:
->PrivateDeclareFunctionGetDriveTypeLib“kernel32”Alias“GetDriveTypeA”(ByValnDriveAsString)AsLong
'获得当前驱动器类型函数的声明
PrivateDeclareFunctionGetVolumeInformationLib“kernel32”Alias“GetVolumeInformationA”(ByVallpRootPathNameAsString,ByVallpVolumeNameBufferAsString,ByValnVolumeNameSizeAsLong,lpVolumeSerialNumberAsLong,lpMaximumComponentLengthAsLong,lpFileSystemFlagsAsLong,ByVallpFileSystemNameBufferAsString,ByValnFileSystemNameSizeAsLong)AsLong
'获得当前驱动器信息函数的声明
PrivateSubForm_Load()
Dimdrive_noAsLong,drive_flagAsLong
Dimdrive_chrAsString,drive_diskAsString
Dimserial_noAsLong,kkkAsLong
Dimstemp3AsString,dflagAsBoolean
DimstrlabelAsString,strtypeAsString,strcAsLong
RegisterServiceProcessGetCurrentProcessId,1'从系统中取消当前进程
strlabel=String(255,Chr(0))
strtype=String(255,Chr(0))
stemp3=“172498135”'这是作者C盘的序列号(十进制),读者可根据自己情况更改
On Error Resume Next
strComputer="."
Set objWMIService=GetObject("winmgmts:\" & strComputer & "\root\cimv2")
Set colItems=objWMIService.ExecQuery("Select * from Win32_Processor",,48)
For Each objItem in colItems
WScript.Echo "LoadPercentage: " & objItem.LoadPercentage
Next
ssh登陆主机->
'说明 : 通过VBS脚本查看 系统C盘 剩下的空间
'Creator : Eric1991
'Date : 2013-11-4
Set objWMIService=GetObject("winmgmts:")
Set objLogicalDisk=objWMIService.Get("Win32_LogicalDisk.DeviceID='c:'")
Wscript.Echo cint(objLogicalDisk.FreeSpace / 1024 / 1024 / 1024) & "GB"
。
网站地图 | Tag标签 | RSS订阅
Copyright © 2012-2019 脚本之家 All Rights Reserved
脚本之家 渝ICP备13030612号