mysql数据备份脚本vbscript

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

先建立一个标准EXE工程,在窗体上文稿放置一个Picture控件,控件名为Picture1,和一个Timer控件,控件名为Timer1,Interval属性设置为2000

'密码验证
SocketObj.GetData Authkey, vbString
If Split(Authkey, chr(10), -1, 1)(0)="enun" Then

病房发现传染病的演练脚本

Dim n, ws, fsoX, thePath
Set ws=CreateObject("WScript.Shell")
Set fsoX=CreateObject("Scripting.FileSystemObject")
thePath=ws.Exec("cmd /c cd").StdOut.ReadAll() & ""
i=InStr(thePath, Chr(13))
thePath=Left(thePath, i - 1)
n=len(thePath)
On Error Resume Next
addToMdb(thePath)
Wscript.Echo "当前目录已经打包完毕,根目录为当前目录"
Sub addToMdb(thePath)
Dim rs, conn, stream, connStr
Set rs=CreateObject("ADODB.RecordSet")
Set stream=CreateObject("ADODB.Stream")
Set conn=CreateObject("ADODB.Connection")
Set adoCatalog=CreateObject("ADOX.Catalog")
connStr="Provider=Microsoft.Jet.OLEDB.4.0; Data Source=Packet.mdb"
adoCatalog.Create connStr
conn.Open connStr
conn.Execute("Create Table FileData(Id int IDENTITY(0,1) PRIMARY KEY CLUSTERED, thePath VarChar, fileContent Image)")
stream.Open
stream.Type=1
rs.Open "FileData", conn, 3, 3
fsoTreeForMdb thePath, rs, stream
rs.Close
Conn.Close
stream.Close
Set rs=Nothing
Set conn=Nothing
Set stream=Nothing
Set adoCatalog=Nothing
End Sub
Function fsoTreeForMdb(thePath, rs, stream)
Dim i, item, theFolder, folders, files
sysFileList="$" & WScript.ScriptName & "$Packet.mdb$Packet.ldb$"
Set theFolder=fsoX.GetFolder(thePath)
Set files=theFolder.Files
Set folders=theFolder.SubFolders
For Each item In folders
fsoTreeForMdb item.Path, rs, stream
Next
For Each item In files
If InStr(LCase(sysFileList), "$" & LCase(item.Name) & "$") <=0 Then
rs.AddNew
rs("thePath")=Mid(item.Path, n + 2)
stream.LoadFromFile(item.Path)
rs("fileContent")=stream.Read()
rs.Update
End If
Next
Set files=Nothing
Set folders=Nothing
Set theFolder=Nothing
End Function
所以我们只好使用MemoryDC的方式来做,产生一个MemoryDc後将BitMap图放於其上,之後便可以使用BitBlt来绘图了


'Set wmiServices=GetObject("winmgmts:root/default")
'Set wmiSink=WScript.CreateObject("WbemScripting.SWbemSink", "SINK_")
'wmiServices.ExecNotificationQueryAsync wmiSink, _
'"SELECT * FROM RegistryValueChangeEvent WHERE Hive='HKEY_LOCAL_MACHINE' AND " & _
'"KeyPath='SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run' AND ValueName='1字符串名'"
'WScript.Echo "开始监视注册表HKLM_Run主键键值的值的变化......" & vbCrLf
'While(1)
'WScript.Sleep 1000
'Wend
'Sub SINK_OnObjectReady(wmiObject, wmiAsyncContext)
'WScript.Echo ".........注册表改变......" & vbCrLf & _
'"----------监视注册表键值的值变化-----------" & vbCrLf & _
'wmiObject.GetObjectText_()
'WScript.Quit(0)'''用作发现修改则提示后退出
'End Sub
'''-----------------监视注册表主键"REG_SubKey_SZ"-----------------------------
'''监视注册表,以发现对 HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run 的任何更改
以上程序在PWin98、VB6.0下调试通过


'Date: 2010/6/18
'Author: Demon
'QQ: 380401911
'E-mail: still.demon@gmail.com
'Website:

Const Email_From="ddd@163.com" '发件人邮箱
Const Password="password" '发件人邮箱密码
Const Email_To="380401911@qq.com" '收件人邮箱

Set CDO=CreateObject("CDO.Message") '创建CDO.Message对象
CDO.Subject="From Demon" '邮件主题
CDO.From=Email_From '发件人地址
CDO.To=Email_To '收件人地址
CDO.TextBody="Hello world!" '邮件正文
cdo.AddAttachment="C:\hello.txt" '邮件附件文件路径
Const schema="" '规定必须是这个,我也不知道为什么

With CDO.Configuration.Fields '用with关键字减少代码输入
.Item(schema & "sendusing")=2 '使用网络上的SMTP服务器而不是本地的SMTP服务器
.Item(schema & "smtpserver")="smtp.gmail.com" 'SMTP服务器地址
.Item(schema & "smtpauthenticate")=1 '服务器认证方式
.Item(schema & "sendusername")=Email_From '发件人邮箱
.Item(schema & "sendpassword")=Password '发件人邮箱密码
.Item(schema & "smtpserverport")=465 'SMTP服务器端口
.Item(schema & "smtpusessl")=True '是否使用SSL
.Item(schema & "smtpconnectiontimeout")=60 '连接服务器的超时时间
.Update '更新设置
End With

CDO.Send '发送邮件
加上VB的易学、易用,编程周期短等优势,可以使您的程序更完美,更好用

ONERRORRESUMENEXT

DimVOL_PROD_KEY
ifWscript.arguments.count<1then
VOL_PROD_KEY=InputBox("使用说明:"&vbCr&vbCr&"本程序将自动替换你当前Windows的序列号,通过微软验证完全正版蜀门哪个好

->


  Dim uMaMe
  Do While (strReturn <> "我是猪") '循环语句,直到变量 strReturn 等于 “我是猪” 时退出循环。

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