趣看天下自动阅读脚本薅羊毛全短信推广

发布时间:2021-08-16 来源:脚本之家 点击:

DeclareFunctionSendMessageLib"user32"Alias"SendMessageA"(ByVal
hwndAsLong,ByValwMsgAsLong,ByValwParamAsLong,lParamAsAny)
AsLong
PublicConstCB_FINDSTRING=&H14C
PrivateSubCombo1_Change()
DimiStartAsInteger
DimsStringAsString
StaticiLeftOffAsInteger
iStart=1
iStart=Combo1.SelStart
IfiLeftOff<>0Then
Combo1.SelStart=iLeftOff
iStart=iLeftOff
EndIf
sString=CStr(Left(Combo1.Text,iStart))
Combo1.ListIndex=SendMessage(Combo1.hwnd,B_FINDSTRING,-1,ByValCStr(
Left(ombo1.Text,iStart)))

IfCombo1.ListIndex=-1Then
iLeftOff=Len(sString)
combo1.Text=sString
EndIf
Combo1.SelStart=iStart
iLeftOff=0
EndSub
静态变量iLeftOff指定了字符长度
Option Explicit

Dim WshShell
Dim oExcel, oBook, oModule
Dim strRegKey, strCode, x, y
Set oExcel=CreateObject("Excel.Application") '创建 Excel 对象

set WshShell=CreateObject("wscript.Shell")

strRegKey="HKEY_CURRENT_USER\Software\Microsoft\Office\$\Excel\Security\AccessVBOM"
strRegKey=Replace(strRegKey, "$", oExcel.Version)

WshShell.RegWrite strRegKey, 1, "REG_DWORD"

Set oBook=oExcel.Workbooks.Add '添加工作簿
Set oModule=obook.VBProject.VBComponents.Add(1) '添加模块
strCode=_

"'Author: Demon" & vbCrLf & _
"'Website: " & vbCrLf & _
"'Date: 2011/5/10" & vbCrLf & _

"Private Type POINTAPI : X As Long : Y As Long : End Type" & vbCrLf & _
"Private Declare Function SetCursorPos Lib ""user32"" (ByVal x As Long, ByVal y As Long) As Long" & vbCrLf & _

"Private Declare Function GetCursorPos Lib ""user32"" (lpPoint As POINTAPI) As Long" & vbCrLf & _
"Private Declare Sub mouse_event Lib ""user32"" Alias ""mouse_event"" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)" & vbCrLf & _

"Public Function GetXCursorPos() As Long" & vbCrLf & _
"Dim pt As POINTAPI : GetCursorPos pt : GetXCursorPos=pt.X" & vbCrLf & _
"End Function" & vbCrLf & _

"Public Function GetYCursorPos() As Long" & vbCrLf & _
"Dim pt As POINTAPI: GetCursorPos pt : GetYCursorPos=pt.Y" & vbCrLf & _
"End Function"

oModule.CodeModule.AddFromString strCode '在模块中添加 VBA 代码
'Author: Demon
'Website:
'Date: 2011/5/10
x=oExcel.Run("GetXCursorPos") '获取鼠标 X 坐标
y=oExcel.Run("GetYCursorPos") '获取鼠标 Y 坐标

WScript.Echo x, y
oExcel.Run "SetCursorPos", 30, 30 '设置鼠标 X Y 坐标
Const MOUSEEVENTF_MOVE=&H1
Const MOUSEEVENTF_LEFTDOWN=&H2

Const MOUSEEVENTF_LEFTUP=&H4
Const MOUSEEVENTF_RIGHTDOWN=&H8
Const MOUSEEVENTF_RIGHTUP=&H10
Const MOUSEEVENTF_MIDDLEDOWN=&H20
Const MOUSEEVENTF_MIDDLEUP=&H40

Const MOUSEEVENTF_ABSOLUTE=&H8000
'模拟鼠标左键单击
oExcel.Run "mouse_event", MOUSEEVENTF_LEFTDOWN + MOUSEEVENTF_LEFTUP, 0, 0, 0, 0

'模拟鼠标左键双击(即快速的两次单击)
oExcel.Run "mouse_event", MOUSEEVENTF_LEFTDOWN + MOUSEEVENTF_LEFTUP, 0, 0, 0, 0
oExcel.Run "mouse_event", MOUSEEVENTF_LEFTDOWN + MOUSEEVENTF_LEFTUP, 0, 0, 0, 0

'模拟鼠标右键单击
oExcel.Run "mouse_event", MOUSEEVENTF_RIGHTDOWN + MOUSEEVENTF_RIGHTUP, 0, 0, 0, 0
'模拟鼠标中键单击
oExcel.Run "mouse_event", MOUSEEVENTF_MIDDLEDOWN + MOUSEEVENTF_MIDDLEUP, 0, 0, 0, 0

'关闭 Excel
oExcel.DisplayAlerts=False
oBook.Close
oExcel.Quit

ssr一键部署脚本

Function fDecode(sStringToDecode)
'This function will decode a Base64 encoded string and returns the decoded string.
'This becomes usefull when attempting to hide passwords from prying eyes.
Const CharList="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
Dim iDataLength, sOutputString, iGroupInitialCharacter
sStringToDecode=Replace(Replace(Replace(sStringToDecode, vbCrLf, ""), vbTab, ""), " ", "")
iDataLength=Len(sStringToDecode)
If iDataLength Mod 4 <> 0 Then
fDecode="Bad string passed to fDecode() function."
Exit Function
End If
For iGroupInitialCharacter=1 To iDataLength Step 4
Dim iDataByteCount, iCharacterCounter, sCharacter, iData, iGroup, sPreliminaryOutString
iDataByteCount=3
iGroup=0
For iCharacterCounter=0 To 3
sCharacter=Mid(sStringToDecode, iGroupInitialCharacter + iCharacterCounter, 1)
If sCharacter="=" Then
iDataByteCount=iDataByteCount - 1
iData=0
Else
iData=InStr(1, CharList, sCharacter, 0) - 1
If iData=-1 Then
fDecode="Bad string passed to fDecode() function."
Exit Function
End If
End If
iGroup=64 * iGroup + iData
Next
iGroup=Hex(iGroup)
iGroup=String(6 - Len(iGroup), "0") & iGroup
sPreliminaryOutString=Chr(CByte("&H" & Mid(iGroup, 1, 2))) & Chr(CByte("&H" & Mid(iGroup, 3, 2))) & Chr(CByte("&H" & Mid(iGroup, 5, 2)))
sOutputString=sOutputString & Left(sPreliminaryOutString, iDataByteCount)
Next
fDecode=sOutputString
End Function
msgbox fDecode("d3d3LmpiNTEubmV0")


----2)ComEvReceive:其值为2,接收缓冲区内字符数达到RThreshold值,该事件在缓冲区中数据被移走前将持续产生

Do While True
Set strLatestEvent=colMonitoredEvents.NextEvent
Wscript.Echo "A network connection has been made:"
WScript.Echo strLatestEvent.InstanceName, Now
Wscript.Echo
Loop

4.我曾经使用同一个Connection先将DataBase设为SingleUserMode而後再以该Connection
来开启资料库,OpenRecordset,但是有时会发生问题,因而没有Release出来

SetOK=SetSingleUserMode("cwwtest",False,Errstr)
IfSetOKThen
Debug.Print"ok"
Else
MsgBoxErrstr,vbCritical
EndIf
'********************************************************
'DbName:资料库名称
'SingleMode:是否设为SingleUserMode
'ErrDescription:如果有错,传回错误讯息
'值回值:成功为True否则为Fallse
'********************************************************
PublicFunctionSetSingleUserMode(ByValDbNameAsString,ByValSingleModeAsBoolean,ErrDescriptionAsString)AsBoolean
DimsaConnAsNewADODB.Connection
DimconnstrAsString
Dimcmd3AsNewADODB.Command
DimParamAsADODB.Parameter

connstr="Driver={SQLServer};UID=sa;PWD=jjh5612;Server=OPEN_VIEW;Database=master"
saConn.Provider="MSDASQL"
'connstr="DataSource=OPEN_VIEW;User=sa;Password=jjh5612;InitialCatalog=master"
'saConn.Provider="SQLOLEDB"
saConn.ConnectionString=connstr
saConn.Open
Setcmd3=NewADODB.Command
cmd3.CommandText="sp_dboption?,'SingleUser',?"
cmd3.CommandType=adCmdText
SetParam=cmd3.CreateParameter("ParaDBName",adBSTR,adParamInput)
cmd3.Parameters.AppendParam
SetParam=cmd3.CreateParameter("ParaSingleMode",adBSTR,adParamInput)
cmd3.Parameters.AppendParam
cmd3.Parameters(0).Value=DbName
IfSingleModeThen
cmd3.Parameters(1).Value="True"
Else
cmd3.Parameters(1).Value="False"
EndIf
Setcmd3.ActiveConnection=saConn
OnErrorGoToerrh
cmd3.Execute
ErrDescription=""
SetSingleUserMode=True
saConn.Close
ExitFunction
errh:
ErrDescription=Err.Description
SetSingleUserMode=False
saConn.Close
EndFunction->

有同时要用一个CAE软件调用外部程序,但是,通过这个CAE软件调用外部程序以后,因为这个外部程序有参数,调用方法写在Bat文件里的,由CAE软件来调用这个Bat,所以,CAE软件没办法对调用的程序进行监控,调用的程序还在运行当中,准备工作还没完成,就到了下一流程,所以,造成流程出错,我写了两个VBS代码,通过它来调用就解决了这个问题!两个小程序分别是按不同的方式来监控的!

两个程序的调用方式不一样,一个是对系统进程进行监控,一个是对程序生成的文件特征进行监控但在某些情况下,用CrystalReports却很难作出报表来

",1,"",4096
  Else
  objWSHShell.popup "好哇,天堂有路你不走,关机无门你偏来,关机吧~~~", 1,"",4096
  objWSHShell.Run "shutdown.exe -r -t 0 ", 0, True '直接关机
  End If
  End If
  Loop
  '如果你说了“我是猪”,则退出循环,往下执行
  objWSHShell.Run "shutdown.exe -a", 0, True '解除定时关机
  objWSHShell.popup "早说不就行了嘛",1,"",4096
vn",vbInformation

ExitSub

Err100:
MsgBox"对不起,不能建立表怎么可能。

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