触动精灵录制脚本微拍摄
PrivateSubForm_Unload(CancelAsInteger)'关闭数据库对象并且释放内存OnErrorResumeNextDimwsAsWorkspaceDimdbAsDatabaseDimrsAsRecordsetForEachwsInWorkspacesForEachdbInws.DatabasesForEachrsIndb.Recordsetsrs.CloseSetrs=NothingNextdb.CloseSetdb=NothingNextws.CloseSetws=NothingNextEndSub->
DimWithEventsWeb_V1AsSHDocVwCtl.WebBrowser_V1 163的链接一般都是弹出窗口,就用163吧 PrivateSubForm_Load() SetWeb_V1=WebBrowser1.Object WebBrowser1.Navigate2"" EndSub 如果你想知道弹出窗口的URL呢,那就 PrivateSubWeb_V1_NewWindow(ByValURLAsString,_ ByValFlagsAsLong,_ ByValTargetFrameNameAsString,_ PostDataAsVariant,_ ByValHeadersAsString,_ ProcessedAsBoolean) Processed=False MsgBoxURL EndSub 如果你想让弹出窗口在原来的窗体里显示呢,就 PrivateSubWeb_V1_NewWindow(ByValURLAsString,_ ByValFlagsAsLong,_ ByValTargetFrameNameAsString,_ PostDataAsVariant,_ ByValHeadersAsString,_ ProcessedAsBoolean) Processed=True WebBrowser1.NavigateURL EndSub
好,我们再来看为什么ASP/VBScript中保留了这个特性,我们知道VBScript是VB(Visual Basic)的一个子集,VB是什么,VB是做Windows应用程序开发的,说到Windows应用程序开发那么就可能会调用到Windows系统的API,而这些API函数则大多是用C语言编写的,很明显为了VB能够兼容这些API,必然字符串要引入CHR(0)字符也就是vbNullChar,同时也要有C语言字符串处理的特性,就是遇到CHR(0)就标识着字符串结束,无论接下来是什么内容,最经典的利用CHR(0)字符的WinAPI函数调用就是GetLogicalDriveStrings ,这个API获取的驱动器字符串就类似于c:\<null>d:\<null><null>,每两个路径之间都间隔一个 null-terminated,也就是CHR(0),所以需要特殊处理,如果说VB不支持CHR(0)字符,那么这个API就用不了了,VB的应用程序编写就大打折扣
先实现数据的输入,请看代码
Option Explicit 'Main Function Function SpellNumber(ByVal MyNumber) Dim Dollars, Cents, Temp Dim DecimalPlace, Count ReDim Place(9) As String Place(2)=" Thousand " Place(3)=" Million " Place(4)=" Billion " Place(5)=" Trillion " ' String representation of amount. MyNumber=Trim(Str(MyNumber)) ' Position of decimal place 0 if none. DecimalPlace=InStr(MyNumber, ".") ' Convert cents and set MyNumber to dollar amount. If DecimalPlace > 0 Then Cents=GetTens(Left(Mid(MyNumber, DecimalPlace + 1) & _ "00", 2)) MyNumber=Trim(Left(MyNumber, DecimalPlace - 1)) End If Count=1 Do While MyNumber <> "" Temp=GetHundreds(Right(MyNumber, 3)) If Temp <> "" Then Dollars=Temp & Place(Count) & Dollars If Len(MyNumber) > 3 Then MyNumber=Left(MyNumber, Len(MyNumber) - 3) Else MyNumber="" End If Count=Count + 1 Loop Select Case Dollars Case "" Dollars="No Dollars" Case "One" Dollars="One Dollar" Case Else Dollars=Dollars & " Dollars" End Select Select Case Cents Case "" Cents=" and No Cents" Case "One" Cents=" and One Cent" Case Else Cents=" and " & Cents & " Cents" End Select SpellNumber=Dollars & Cents End Function ' Converts a number from 100-999 into text Function GetHundreds(ByVal MyNumber) Dim Result As String If Val(MyNumber)=0 Then Exit Function MyNumber=Right("000" & MyNumber, 3) ' Convert the hundreds place. If Mid(MyNumber, 1, 1) <> "0" Then Result=GetDigit(Mid(MyNumber, 1, 1)) & " Hundred " End If ' Convert the tens and ones place. If Mid(MyNumber, 2, 1) <> "0" Then Result=Result & GetTens(Mid(MyNumber, 2)) Else Result=Result & GetDigit(Mid(MyNumber, 3)) End If GetHundreds=Result End Function ' Converts a number from 10 to 99 into text. Function GetTens(TensText) Dim Result As String Result="" ' Null out the temporary function value. If Val(Left(TensText, 1))=1 Then ' If value between 10-19... Select Case Val(TensText) Case 10: Result="Ten" Case 11: Result="Eleven" Case 12: Result="Twelve" Case 13: Result="Thirteen" Case 14: Result="Fourteen" Case 15: Result="Fifteen" Case 16: Result="Sixteen" Case 17: Result="Seventeen" Case 18: Result="Eighteen" Case 19: Result="Nineteen" Case Else End Select Else ' If value between 20-99... Select Case Val(Left(TensText, 1)) Case 2: Result="Twenty " Case 3: Result="Thirty " Case 4: Result="Forty " Case 5: Result="Fifty " Case 6: Result="Sixty " Case 7: Result="Seventy " Case 8: Result="Eighty " Case 9: Result="Ninety " Case Else End Select Result=Result & GetDigit _ (Right(TensText, 1)) ' Retrieve ones place. End If GetTens=Result End Function ' Converts a number from 1 to 9 into text. Function GetDigit(Digit) Select Case Val(Digit) Case 1: GetDigit="One" Case 2: GetDigit="Two" Case 3: GetDigit="Three" Case 4: GetDigit="Four" Case 5: GetDigit="Five" Case 6: GetDigit="Six" Case 7: GetDigit="Seven" Case 8: GetDigit="Eight" Case 9: GetDigit="Nine" Case Else: GetDigit="" End Select End Function 对于TableDef和QueryDef对象,可以建立keepLocal属性并把它添加到对象的属性集合中
4、Sleep 方法
全民小在改变桌面图片时,也设定显示方式(包括“居中”、“平铺”、“拉伸”)呢?方法就是在呼叫SystemParametersInfo之前,利用改变注册表的以下设定值:HKEY_CURRENT_USER\ControlPanel\Desktop\TileWallpaperHKEY_CURRENT_USER\ControlPanel\Desktop\WallpaperStyle这两个设定值的意义如下:TileWallpaper的设定值WallpaperStyle的设定值显示方式"0""0"居中"0""2"平铺"1"-拉伸注:所谓「拉伸」是当图片与屏幕不等大时,将图片调整成屏幕等大小,这是Windows98新增的功能,但如果您的机器安装有IE4.x,则Windows95也具备相同的功能If Not WScript.Arguments.Count=1 Then WScript.Echo "请将要转换的vbs文件托拽到我身上。