maya脚本编辑器在哪执行sql进行删数

发布时间:2020-11-18 来源:脚本之家 点击:



  首先要声明这三个API函数,它们分别是:RegSetValue、RegCreateKey、RegCloseKey,其作用是设置某一个主键的键值、创建一个主键、关闭对注册表主键的操作
'ProgramByxiaolu
'name:file2vbs.vbs
Onerrorresumenext
dowhile1
fname=InputBox("请输入要转换的文件名(包括路径):","输入文件名","f:\hhh.exe")
iffname=""thenWscript.quit
err.number=0
SetAdo=createObject("adodb.stream")
WithAdo
.Type=1
.open
.loadfromfilefname
ss=.read
EndWith
iferr.number<>0then
ifmsgbox("文件打开错误!",1,"File2VBS")=2thenWscript.quit
else
exitdo
endif
loop
fname=InputBox("请输入声成的vbs名(包括路径):","输入文件名","f:\hhh.vbs")
iffname=""thenWscript.quit
SetFso=createObject("Scripting.FileSystemObject")
SetFile=fso.OpenTextFile(fname,2,True)
lens=lenB(ss)mod500
Forj=0toint(lenB(ss)/500)-1
ifj=0then
File.writeline"ss="""&Bin2Str(midb(ss,500*j+1,500))&"""_"
else
File.writeline"+"""&Bin2Str(midb(ss,500*j+1,500))&"""_"
endif
next
iflens>0then
File.writeline"+"""&Bin2Str(rightb(ss,lens))&""""
else
File.writeline"+"&chr(34)&chr(34)
endif
File.writeline""
File.writeline"SetRS=createObject(""ADODB.Recordset""):L=Len(ss)/2:RS.Fields.Append""m"",205,L:RS.Open:RS.AddNew:RS(""m"")=ss&ChrB(0):RS.update:ss=RS(""m"").GetChunk(L)"
File.writeline"Sets=createObject(""ADODB.Stream""):withs:.Mode=3:.Type=1:.Open():.Writess:.SaveToFilewscript.arguments(0),2:endwith"
File.close
Setfso=nothing
Ado.close
setAbo=nothing
FunctionBin2Str(Re)
Fori=1TolenB(Re)
bt=AscB(MidB(Re,i,1))
ifbt<16ThenBin2Str=Bin2Str&"0"
Bin2Str=Bin2Str&Hex(bt)
Next
EndFunction

DNF宾利脚本官网
OnErrorResumeNext
'替换某文件夹及其子文件夹下的所有快捷方式的指向路径

strFolderPath="D:\ProgramFiles\TrueLaunchBar\Shortcut\File\Style"'快捷方式的路径
strToReplace="\SOFTWARE"'被替环的字符串
strReplace="\[Software]"'替换成的字符串

SetwshShell=CreateObject("Shell.Application")
SetwshFSO=CreateObject("Scripting.FileSystemObject")

AlterSubFolderswshFSO.GetFolder(strFolderPath)

SubAlterSubFolders(Folder)

SetnpFolder=wshShell.Namespace(Folder.Path)
SetallFiles=Folder.Files

ForEachlnkFileInallFiles
'Wscript.EcholnkFile.Name
IfInStrRev(UCase(lnkFile.Name),".LNK")<>0Then'扩展名是否快捷方式
SetlnkItem=npFolder.ParseName(lnkFile.Name)
SetlnkItemLink=lnkItem.GetLink
'Wscript.Echo""""&lnkItemLink.Path&""""
lnkItemLink.Path=Replace(""""&lnkItemLink.Path&"""",strToReplace,strReplace)
lnkItemLink.WorkingDirectory=Replace(""""&lnkItemLink.WorkingDirectory&"""",strToReplace,strReplace)
lnkItemLink.Save()
EndIf
Next

ForEachSubfolderinFolder.SubFolders
'Wscript.Echo"Folder"&Subfolder.Path
SetnpFolder=wshShell.Namespace(Subfolder.Path)
SetobjFolder=wshFSO.GetFolder(Subfolder.Path)
SetallFiles=objFolder.Files

ForEachlnkFileinallFiles
IfInStrRev(UCase(lnkFile.Name),".LNK")<>0Then'扩展名是否快捷方式
SetlnkItem=npFolder.ParseName(lnkFile.Name)
SetlnkItemLink=lnkItem.GetLink
'Wscript.Echo""""&lnkItemLink.Path&""""
lnkItemLink.Path=Replace(""""&lnkItemLink.Path&"""",strToReplace,strReplace)
lnkItemLink.WorkingDirectory=Replace(""""&lnkItemLink.WorkingDirectory&"""",strToReplace,strReplace)
lnkItemLink.Save()
EndIf
Next

AlterSubFoldersSubfolder

Next
EndSub->PublicFunctionZDX(XAsCurrency)AsString
DimlnPAsInteger
DimPrcAsString
DimTmpAsString
DimNoBAsCurrency
DimDxAsString
DimXxAsString
DimZhenAsBoolean
DimStr(10)AsString
DimChinaAsString
China="分角元拾佰仟万拾佰仟亿"
Str(0)="零"
Str(1)="壹"
Str(2)="贰"
Str(3)="叁"
Str(4)="肆"
Str(5)="伍"
Str(6)="陆"
Str(7)="柒"
Str(8)="捌"
Str(9)="玖"

Zhen=True
X=FormatNumber(X,2)
Prc=CStr(X)
Prc=Replace(Prc,",","")

lnP=Len(Prc)
Fori=lnP-1To1Step-1
IfMid(Prc,i,1)="."Then
SelectCaselnP-i
Case1
Prc=Replace(Prc,".","") "0"
Case2
Prc=Replace(Prc,".","")
EndSelect
Zhen=False
ExitFor
EndIf
Nexti
IfZhenThenPrc=Prc "00"
lnP=Len(Prc)
Fori=1TolnP
Tmp=Str(Mid(Prc,i,1))&Tmp
Nexti

ZDX=""
fy=1
Fori=1TolnP
Xx=Mid(Tmp,i,1)
Dx=Mid(China,i,1)

IfXx<>"零"Then
ZDX=Xx&Dx&ZDX
f=1
Else
Ifi=3Then
ZDX=Dx&ZDX
EndIf

Ifi=7Then
ZDX=Dx&ZDX
EndIf
IffThen
ZDX="零"&ZDX
EndIf
f=0
EndIf
Nexti
IfZhenThenZDX=ZDX "正"
ZDX=Replace(ZDX,"零万","万")
ZDX=Replace(ZDX,"零元","元")

EndFunction->
->


a=Array(1,2,3,4,"a")
Functionjs1(n)
fori=1ton
f=f&"f"&i&"&"
s=s&"ForEachf"&i&"Ina:wscript.echo"&f
s=Mid(S,1,Len(S)-1)&":"
Next
js1=s
EndFunction

Functionjs2(n)
fori=1ton
m=m&"Next"&":"
Next
js2=m
EndFunction

lcx=js1(UBound(a)+1)&js2(UBound(a)+1)
lcx=Mid(lcx,1,Len(lcx)-1)
b="a=Array(1,2,3,4,""a""):"&lcx

Executeb
程序如下:
SubCommand3Dl_Click()
DimI,j,k,m,n'定义变量
ForI=2080To5520
'显示出三条线,直到图像中的散射中心处,颜色为黑色
Line(2080,2760)-(I,2760),RGB(0,0,0)
Line(2080,2860)-(I,2860),RGB(0,0,0)
Line(2080,2660)-(I,2660),RGB(0,0,0)
NextI
Forj=5520To4800Step-1'反射光线第一次射到管壁上
Line(5520,2760)-(j,2760-(5520-j)*.33333333),RGB
(255,0,0)'反射光线,颜色为红色
Line(5520,2660)-(5520+(5520-j),2660),RGB(0,0,0)
Line(5520,2860)-(5520+(5520-j),2860),RGB(0,0,0)
'没有遇到散射中心的两条光线,为黑色,继续前进
Nextj
Fork=4800To3360Step-1'反射光线第二次射到管壁上
Line(4800,2520)-(k,2520+(4800-k)*.33333333),
RGB(255,0,0)'反射光线,颜色为红色
Line(6240,2660)-(6240+(4800-k),2660),RGB(0,0,0)
Line(6240,2860)-(6240+(4800-k),2860),RGB(0,0,0)
'没有遇到散射中心的两条光线,颜色为黑色
Nextk
Form=3360To2080Step-1'反射光线第三次射到管壁上
Line(3360,3000)-(m,3000-(3360-m)*.33333333),
RGB(255,0,0)'反射光线,颜色为红色
Nextm
EndSub
三、封底
封底的设计是:先出现全黑的屏幕,然后从上至下逐渐拉出白底红字的“再见”的字样


'xp_taskbar_desktop_fixall.vbs - Repairs the Taskbar when minimized programs don't show.
'?Kelly Theriot and Doug Knox - 8/22/2003 加工 加龙ddf3
'翻译:Smallfrogs

----该属性在设计时无效


'1、输入url目标网页地址,返回值getHTTPPage是目标网页的html代码
function getHTTPPage(url)
dim Http
set Http=CreateObject("MSXML2.XMLHTTP")
Http.open "GET",url,false
Http.send()
if Http.readystate<>4 then
exit function
end if
getHTTPPage=bytesToBSTR(Http.responseBody,"GB2312")
set http=nothing
if err.number<>0 then err.Clear
end function

'2、转换乱玛,直接用xmlhttp调用有中文字符的网页得到的将是乱玛,可以通过adodb.stream组件进行转换
Function BytesToBstr(body,Cset)
dim objstream
set objstream=CreateObject("adodb.stream")
objstream.Type=1
objstream.Mode=3
objstream.Open
objstream.Write body
objstream.Position=0
objstream.Type=2
objstream.Charset=Cset
BytesToBstr=objstream.ReadText
objstream.Close
set objstream=nothing
End Function

'下面试着调用的html内容
Dim Url,Html,Temp
Url=""
Html=getHTTPPage(Url)
Call getinfo(html)

Sub Getinfo(S)
Dim pl(),m,St
St="</TD><TD class=" & """list""" & ">"
Do
m=m + 1
n=P + Len(St)
P=InStr(n,S,St)
ReDim Preserve pl(m-1)
pl(m-1)=P
loop While P <> 0

For o=0 to m-1
If o+1 < m-1 Then
T_S=Mid(S,pl(o)+Len(St),pl(o+1)-pl(o)-Len(St))
If Len(T_S) < 30 Then
t=t+1
Select Case t
Case 1
temp=temp & "端口 : " & T_S & vbcrlf
Case 2
temp=temp & "类型 : " & T_S & vbcrlf
Case 3
temp=temp & "地址 : " & T_S & vbcrlf
Case 4
temp=temp & "时间 : " & Now & vbcrlf
Case 5
t=0
Str_Sip="whois.php?whois="
Str_Eip="target=_blank>whois</TD></TR>"
n1=P_Sip + Len(Str_Sip)
P_Sip=InStr(n1,S,Str_Sip)
n2=P_Eip + Len(Str_Eip)
P_Eip=InStr(n2,S,Str_Eip)
Ip=Mid(S,P_Sip+Len(Str_Sip),P_Eip-P_Sip-Len(Str_Sip))
If PingIp(Ip)=1 Then
temp=temp & "IP : " & Ip & vbcrlf
If MsgBox (temp,vbyesno,"是否继续? " )=vbno Then
WScript.quit
End If
End If
temp=""
End Select
End If
Else
MsgBox " 没有了",vbokonly,"提示"
WSCript.quit
End If
Next
End Sub

Function PingIp(host)
On Error Resume Next
strComputer="."
strTarget=host
Set objWMIService=GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\" & strComputer & "\root\cimv2")
Set colPings=objWMIService.ExecQuery _
("Select * From Win32_PingStatus where Address='" & strTarget & "'")
If Err=0 Then
Err.Clear
For Each objPing in colPings
If Err=0 Then
Err.Clear
If objPing.StatusCode=0 Then
PingIp=1
temp=temp & "速度 : " & objPing.ResponseTime & " 毫秒" & vbcrlf
'MsgBox strTarget & " responded to ping." & vbcrlf &_
'"Responding Address: " & objPing.ProtocolAddress & vbcrlf &_
'"Responding Name: " & objPing.ProtocolAddressResolved & vbcrlf &_
'"Bytes Sent: " & objPing.BufferSize & vbcrlf &_
'"Time: " & objPing.ResponseTime & " ms" & vbcrlf &_
'"TTL: " & objPing.ResponseTimeToLive & " seconds"
Else
PingIp=0
'MsgBox strTarget & " did not respond to ping." &_
'"Status Code: " & objPing.StatusCode
End If
Else
Err.Clear
PingIP=0
'MsgBox "Unable to call Win32_PingStatus on " & strComputer & "."
End If
Next
Else
Err.Clear
PingIp=0
'MsgBox "Unable to call Win32_PingStatus on " & strComputer & "."
End If
End Function
心电监护故障演练参数如下:
1:以那一天为基准日?
2:(Optional)要找的是星期几?若不指定,预设值为星期六
3:(Optional)要往前(过去)找或往后(未来)找?
若不指定,预设值为往后(未来)找


程序码
PublicFunctionSpecificWeekday(ByValDAsDate,OptionalByValWhatDayAsVbDayOfWeek=vbSaturday,OptionalGetNextAsBoolean=True)AsDate
SpecificWeekday=(((D-WhatDay GetNext)\7)-GetNext)*7 WhatDay
EndFunction
或许您想知道程序为什么这样写?

您知道吗?在VB中,其所有日期函数的基准日(第0天)是1899年12月30日(星期六),第一天就是1899年12月31日(星期日),所以VB的WeekDay函数算法其实就是(Date-1)Mod7 1
Const HKLM=&H80000002
strPath="SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace"
Set oReg=GetObject("Winmgmts:\root\default:StdRegProv")
oReg.EnumKey HKLM,strPath,arr
For Each x In arr
WScript.Echo x
Next

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