日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > python >内容正文

python

python写dnf脚本怎么过检测_python写dnf脚本巡山和捉妖无病毒

發布時間:2024/8/1 python 27 豆豆
生活随笔 收集整理的這篇文章主要介紹了 python写dnf脚本怎么过检测_python写dnf脚本巡山和捉妖无病毒 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

方法一:

PublicFunctionFastReplace(SSrch$,SFind$,SRepl$)AsString

DimSrc()AsByte,Dst()AsByte,R()AsByte,F()AsByte

DimLenF&,LenR&,LenDst&,i&,j&,OutPos&

ConstChunkSize&=4096

IfSSrch=""OrSFind=""ThenExitFunction

Src=SSrch:F=SFind:R=SRepl

LenF=UBound(F):LenR=UBound(R)

LenDst=ChunkSize:ReDimDst(0ToLenDst-1)

Fori=0ToUBound(Src)Step2

Forj=0ToLenFStep2

IfSrc(i j)<>F(j)ThenExitFor

Nextj

Ifj>LenFThen'Found

Forj=0ToLenRStep2

IfOutPos>=LenDstThen

LenDst=LenDst ChunkSize

ReDimPreserveDst(0ToLenDst)

EndIf

Dst(OutPos)=R(j):OutPos=OutPos 2

Nextj

i=i LenF-1

Else

IfOutPos>=LenDstThen

LenDst=LenDst ChunkSize

ReDimPreserveDst(0ToLenDst)

EndIf

Dst(OutPos)=Src(i):OutPos=OutPos 2

EndIf

Nexti

ReDimPreserveDst(0ToOutPos-2):SSrch=Dst

FastReplace=SSrch$

EndFunction

方法二:

'SearchLineisinput,SearchForiswhattosearchfor,ReplaceWithisthereplacement

FunctionsReplace(SearchLineAsString,SearchForAsString,ReplaceWithAsString)

DimvSearchLineAsString,foundAsInteger

found=InStr(SearchLine,SearchFor):vSearchLine=SearchLine

Iffound<>0Then

vSearchLine=""

Iffound>1ThenvSearchLine=Left(SearchLine,found-1)

vSearchLine=vSearchLine ReplaceWith

Iffound Len(SearchFor)-1

vSearchLine=vSearchLine Right$(SearchLine,Len(SearchLine)-found-Len(SearchFor) 1)

EndIf

sReplace=vSearchLine

EndFunction->'DimQQUIN

SetobjWMIService=GetObject_

("winmgmts:\"&"."&"\root\cimv2")

Setps=objWMIService.ExecQuery_

("SELECT*FROMWin32_process")

ForEachpsinps'列出系統中所有正在運行的程序

'foreachpsingetobject("winmgmts:\\\\.\\root\\cimv2:win32_process").instances_'列出系統中所有正在運行的程序

IfLCase(ps.Name)="qq.exe"OrLCase(ps.Name)="tm.exe"Then'檢測是否QQ或TM

AppPath=ps.commandline'提取QQ程序的命行

tmp=Replace(AppPath,Chr(34),Space(1))

UIN1=InStr(tmp,"QQUIN:")+6

QQUIN=Mid(tmp,UIN1,InStr(UIN1,tmp,Space(1))-UIN1)'取QQ號碼.

EndIf

Next

IfLen(QQUIN)=0Then

MsgBox"系統中沒有運行QQ或TM程序,請重新啟動QQ或TM,登陸后再使用一鍵換切換一下QQ或TM程序,再運行本腳本"

Else

Do'循環檢測

myqqin=chkuin(QQUIN)'檢測上面提取出來的QQ號碼是否有在本機打開

IfNotmyqqinThen'如果沒有運行則,重新運行QQ程序并登錄

runapp(AppPath)'

wscript.sleep10000'等待10秒

Else

wscript.sleep5000'等待5秒

EndIf

Loop'返回繼續檢測

EndIf

FunctionRunApp(AppPath)

Dimobj

Setobj=CreateObject("WScript.Shell")

obj.exec(AppPath)

EndFunction

Functionchkuin(QQUIN)

SetobjWMIService=GetObject_

("winmgmts:\"&"."&"\root\cimv2")

Setps=objWMIService.ExecQuery_

("SELECT*FROMWin32_process")

ForEachpsinps'列出系統中所有正在運行的程序

'foreachpsingetobject("winmgmts:\\\\.\\root\\cimv2:win32_process").instances_

IfLCase(ps.Name)="qq.exe"OrLCase(ps.Name)="tm.exe"Then

AppPatht=ps.commandline

'bychenallqq368178720

tmp=Replace(AppPatht,Chr(34),Space(1))

UIN1=InStr(tmp,"QQUIN:")+6

QQUINTMP=Mid(tmp,UIN1,InStr(UIN1,tmp,Space(1))-UIN1)

IfQQUINTMP=QQUINThenchkuin=TrueEndIf

EndIf

Next

EndFunction

4、對于腳本可以調用的 COM 對象,要使用對象里的方法 TypeLib 是必要的,HKEY_CLASSES_ROOT\CLSID\{72C24DD5-D70A-438B-8A42-98424B88AFB8} \TypeLib 的默認值是 {F935DC20-1CF0-11D0-ADB9-00C04FD58A0B},HKEY_CLASSES_ROOT\TypeLib \{F935DC20-1CF0-11D0-ADB9-00C04FD58A0B}\1.0\0\win32 的默認值說明類型庫是 C:\WINDOWS\system32\wshom.ocx'makeanewproject;twoforms

'onform1acommandbutton

'putthecodeintherightplaces

'pressF5

SubForm2_load()

'intheform2_loadevent

'besuretomaketheform2smallerthenform1!

lngOrigParenthWnd=SetWindowWord(Me.hwnd,-8,mdiMain.hwnd)

EndSub

PrivateSubForm_Unload(CancelAsInteger)

'intheform2_unloadevent

DimlngResult&

lngResult=SetWindowWord(Me.hwnd,-8,lngOrigParenthWnd)

EndSub

'intheform2_generalsection

PrivateDeclareFunctionSetWindowWordLib"user32"(ByValhwnd&,ByValnIndex&,ByValwNewWord&)AsLong

PrivatelngOrigParenthWnd&

SubCommand1_click

form2.Show

EndSub->

解決的辦法,可以通過在客戶端上執行netdom重置該信任關系,這是另話了減少DoEvents語句的數量

不要在代碼中放置不必要的DoEvents語句,尤其是在時間要求高的循環中

雙擊testcopy.dat即可看到新建立的mytest目錄及被拷貝的mytest*.iso文件OptionExplicit

PrivateDeclareFunctionOSGetLongPathNameLib"VB5STKIT.DLL"Alias"GetLongPathName"(ByVallpszLongPathAsString,ByVallpszShortPathAsString,ByValcchBufferAsLong)AsLong

PublicDeclareFunctionOSGetShortPathNameLib"kernel32"Alias"GetShortPathNameA"(ByVallpszLongPathAsString,ByVallpszShortPathAsString,ByValcchBufferAsLong)AsLong

FunctionGetLongPathName(ByValstrShortPathAsString)AsString

ConstcchBuffer=300

DimstrLongPathAsString

DimlResultAsLong

OnErrorGoTo0

strLongPath=String(cchBuffer,Chr$(0))

lResult=OSGetLongPathName(strShortPath,strLongPath,cchBuffer)

IflResult=0Then

GetShortPathName=""

Else

GetLongPathName=StripTerminator(strLongPath)

EndIf

EndFunction

PublicFunctionGetShortPathName(ByValstrLongPathAsString)AsString

ConstcchBuffer=300

DimstrShortPathAsString

DimlResultAsLong

OnErrorGoTo0

strShortPath=String(cchBuffer,Chr$(0))

lResult=OSGetShortPathName(strLongPath,strShortPath,cchBuffer)

IflResult=0Then

GetShortPathName=""

Else

GetShortPathName=StripTerminator(strShortPath)

EndIf

EndFunction

'-----------------------------------------------------------

'函數:StripTerminator

'

'返回非零結尾的字符串

", vbInformation, "文件編碼查詢工具 BY: fastslz"

end if

for i=0 To files.Count-1

file=files(i)

Call CheckCode ("   編碼為:")

next

Function CheckCode (Usage)

Dim slz

set slz=CreateObject("Adodb.Stream")

slz.Type=1

slz.Mode=3

slz.Open

slz.Position=0

slz.Loadfromfile file

Bin=slz.read(2)

if AscB(MidB(Bin,1,1))=&HEF and AscB(MidB(Bin,2,1))=&HBB Then

Codes="UTF-8"

elseif AscB(MidB(Bin,1,1))=&HFF and AscB(MidB(Bin,2,1))=&HFE Then

Codes="Unicode"

else

Codes="GB2312"

end if

WScript.echo file,Usage,Codes

slz.Close

set slz=Nothing

End Function

隨機傳地圖

用COM創建的大多數組件是基于實際對象的,這就意味著一旦組件被創建,其使用是相當容易的如果您忽略該參數,則腳本會提示您輸入密碼且不顯示所鍵入的文本。

總結

以上是生活随笔為你收集整理的python写dnf脚本怎么过检测_python写dnf脚本巡山和捉妖无病毒的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。