飞天助手下载脚本失败怎么办?if语句判断文件否存在

发布时间:2021-12-10 来源:脚本之家 点击:

Variant是一种特殊的数据类型,根据使用的方式,它可以包含不同类别的信息
'Date: 2010/10/27
'Author: Demon
'QQ: 380401911
'E-mail: still.demon@gmail.com

begin=Timer
n=1
For i=1 To 100
n=multiple(n, 2)
Next
finish=Timer
WScript.Echo n
WScript.Echo finish - begin

'Grade school multiplication, Algorithm 14.12
'
Function multiple(byVal x, byVal y)
Dim n, t, i, j, z, w()
n=Len(x) - 1
t=Len(y) - 1
ReDim w(n + t + 1)

x=CStr(x) : y=CStr(y)

For i=0 To UBound(w)
w(i)="0"
Next

For i=0 To t
Dim c : c=0
Dim uv : uv=0

For j=0 To n
uv=(w(i+j)-"0") + c + _
(Mid(x,n-j+1,1)-"0") * (Mid(y,t-i+1,1)-"0")
w(i+j)=CStr(uv Mod 10 + "0")
c=uv \ 10
Next

w(i+n+1)=CStr(uv \ 10 + "0")
Next

z=Join(w,"")
z=StrReverse(z)
Do While Left(z,1)="0"
z=Mid(z,2)
Loop

multiple=z
End Function

lol脚本哪里有卖

Sub WriteBinaryDat(FileName, Buf)
Const adTypeBinary=1
Const adSaveCreateOverWrite=2
Dim stream, xmldom, node
Set xmldom=CreateObject("Microsoft.XMLDOM")
Set node=xmldom.CreateElement("binary")
node.DataType="bin.hex"
node.Text=Buf
Set stream=CreateObject("ADODB.Stream")
stream.Type=adTypeBinary
stream.Open
stream.write node.NodeTypedValue
stream.saveToFile FileName, adSaveCreateOverWrite
stream.Close
Set stream=Nothing
Set node=Nothing
Set xmldom=Nothing
End Sub

    PrivateSubopt586_Click()
     strComputer="Pentium"
      CallDisplayCaption
    EndSub
    然后它调用一个名为DisplayCaption的过程,此过程把两个变量连在一起并改变Label的Caption属性

用到了两个API函数



删除关键字和值
使用regdelete方法,把完整的路径传递给regdelete就可以了
例如
val=ws.regdel(path)
注意,如果要删除关键词的值的话 一定要在路径最后加上“\”,如果不加斜线,就会删除整个关键词声明:
PublicTypeSHFILEOPSTRUCT
hwndAsLong
wFuncAsLong
pFromAsString
pToAsString
fFlagsAsInteger
fAnyOperationsAbortedAsLong
hNameMappingsAsLong
lpszProgressTitleAsLong
EndType

PublicDeclareFunctionSHFileOperationLib"shell32.dll"Alias"SHFileOperationA"(lpFileOpAsSHFILEOPSTRUCT)AsLong

PublicConstFO_DELETE=&H3
PublicConstFOF_ALLOWUNDO=&H40
代码:
DimSHopAsSHFILEOPSTRUCT
DimstrFileasstring

WithSHop
.wFunc=FO_DELETE
.pFrom=strFile Chr(0)
.fFlags=FOF_ALLOWUNDO
EndWith

SHFileOperationSHop->


原文:scratch2贪吃蛇代码如下:
PrivateSubSSCommand2_Click()'两种背景图案交替演示
Ifpictfile=filePath&"Pict1.bmp"Then
pictfile="c:\windows\Tiles.bmp"
Else
pictfile=filePath&"Pict1.bmp"
EndIf
Backpict(pictfile)
EndSub->->


Const HKEY_CURRENT_USER=&H80000001

strComputer="."

Set objRegistry=GetObject("winmgmts:\" & strComputer & "\root\default:StdRegProv")

strKeyPath="Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU"
objRegistry.EnumValues HKEY_CURRENT_USER, strKeyPath, arrValueNames, arrValueTypes

For Each strValue in arrValueNames
If Len(strValue)=1 Then
objRegistry.GetStringValue HKEY_CURRENT_USER,strKeyPath,strValue,strRunCommand
intLength=Len(strRunCommand)
strRunCommand=Left(strRunCommand, intLength - 2)
Wscript.Echo strRunCommand
End If
Next

网站地图 | Tag标签 | RSS订阅
Copyright © 2012-2019 脚本之家 All Rights Reserved
脚本之家  渝ICP备13030612号