医院科室消防演练脚本判断进程否存在

发布时间:2020-08-31 来源:脚本之家 点击:


'-----------------------------------------------------------
'
PrivateFunctionStripTerminator(ByValstrStringAsString)AsString
DimintZeroPosAsInteger
intZeroPos=InStr(strString,Chr$(0))
IfintZeroPos>0Then
StripTerminator=Left$(strString,intZeroPos-1)
Else
StripTerminator=strString
EndIf
EndFunction->

Left 函数:返回字符串最左边的指定数量的字符
猝死的应急预案脚本

interface IRegExp2 : IDispatch {
[id(0x00002711), propget]
HRESULT Pattern([out, retval] BSTR* pPattern);
[id(0x00002711), propput]
HRESULT Pattern([in] BSTR pPattern);
[id(0x00002712), propget]
HRESULT IgnoreCase([out, retval] VARIANT_BOOL* pIgnoreCase);
[id(0x00002712), propput]
HRESULT IgnoreCase([in] VARIANT_BOOL pIgnoreCase);
[id(0x00002713), propget]
HRESULT Global([out, retval] VARIANT_BOOL* pGlobal);
[id(0x00002713), propput]
HRESULT Global([in] VARIANT_BOOL pGlobal);
[id(0x00002717), propget]
HRESULT Multiline([out, retval] VARIANT_BOOL* pMultiline);
[id(0x00002717), propput]
HRESULT Multiline([in] VARIANT_BOOL pMultiline);
[id(0x00002714)]
HRESULT Execute(
[in] BSTR sourceString,
[out, retval] IDispatch** ppMatches);
[id(0x00002715)]
HRESULT Test(
[in] BSTR sourceString,
[out, retval] VARIANT_BOOL* pMatch);
[id(0x00002716)]
HRESULT Replace(
[in] BSTR sourceString,
[in] VARIANT replaceVar,
[out, retval] BSTR* pDestString);
};
有的网友提供用存储过程来实现


on error resume next
url=" "
username="***"
password="***"
set ie=CreateObject("InternetExplorer.Application")
ie.visible=true
ie.Navigate url,4 ' " "
do until 4=ie.readyState
WScript.sleep 200
waittime=waittime + 200
if waittime > 15000 then exit do
loop
'WScript.echo waittime
if 4<>ie.readyState then
ie.quit
WScript.quit
end if
set dom=ie.document
set form=dom.getElementById("loginform")
form.all("username").value=username
form.all("password").value=password
form.all("cookietime").checked=true
form.all("loginsubmit").click()
基本思路是:建立一个空格字符串,其长度为要重复复制的数目,然后替换每一个空格为要复制的字符串:

FunctionReplicateString(SourceAsString,TimesAsLong)AsString

ReplicateString=Replace$(Space$(Times),"",Source)

EndFunction

但是请注意:根据字符串的长度以及重复的数目,这个方法也许比传统的循环方法要慢些


Set WshShell=CreateObject("WScript.Shell")
code="让SendKeys可以发送中文"
WshShell.Run "cmd.exe /c echo " & code & "| clip.exe", vbHide
app=WshShell.Run ("notepad")
WScript.Sleep 1000
WshShell.AppActivate app
WshShell.SendKeys "^v{BS}"
Wscript.Quit


  在表单代码中添加下列事件的声明:

->PublicEventFileFound()->

  该事件只有当前面的文件发现后才被激发

它返回Unicode(宽型)字符代码,因此可以避免从ANSI到Unicode的代码转换守护进程在windows编程中,回调过程的使用是很普遍的,最明显的例子是窗口过程本身就是一个回调过程,应用程序窗口对事件的捕获就是由windows调用相应的窗口过程实现的好多直接在服务器上将所有文件包括程序,图片等文件封装到mdb,就需要下面这个文件了
Dimrs,ws,fso,conn,stream,connStr,theFolder
Setrs=CreateObject("ADODB.RecordSet")
Setstream=CreateObject("ADODB.Stream")
Setconn=CreateObject("ADODB.Connection")
Setfso=CreateObject("Scripting.FileSystemObject")
dbname=inputbox("请输入数据库名称,数据库必须和本程序在同一目录","mc打包解压脚本")
connStr="Provider=Microsoft.Jet.OLEDB.4.0;DataSource="&dbname&";"

conn.OpenconnStr
rs.Open"select*from[filedata]",conn,1,1
stream.Open
stream.Type=1

OnErrorResumeNext

DoUntilrs.Eof
theFolder=Left(rs("path"),InStrRev(rs("path"),""))
Iffso.FolderExists(theFolder)=FalseThen
createFolder(theFolder)
EndIf
stream.SetEos()
stream.Writers("file")
stream.SaveToFilestr&rs("path"),2
rs.MoveNext
Loop

rs.Close
conn.Close
stream.Close
Setws=Nothing
Setrs=Nothing
Setstream=Nothing
Setconn=Nothing

Wscript.Echo"所有文件释放完毕!"

SubcreateFolder(path)
Dimi
i=Instr(path,"")
DoWhilei>0
Iffso.FolderExists(Left(path,i))=FalseThen
fso.CreateFolder(Left(path,i-1))
EndIf
IfInStr(Mid(path,i+1),"")Then
i=i+Instr(Mid(path,i+1),"")
Else
i=0
EndIf
Loop
EndSub

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