c语言可以写脚本吗sh下执行sh

发布时间:2020-06-29 来源:脚本之家 点击:

欲将TextBox内的文字向右靠,除了将Alignment属性设为「1-靠右对 」之外,亦 将MultiLine属性设为True
wdOpenFormatXMLTemplateMacroEnabled 12 启用了宏的 XML 模板格式

lol脚本辅助免费
该命令可在运行带有 IIS 6.0 的 Windows Server 2003 家族的成员的本地计算机或远程计算机上执行

在Windows推出初期,能够用来开发Windows应用软件的工具只有“MicrosoftWindowsSoftwareDevelopmentKit”,简称SDK

在前面的专栏中,您为我们展示了如何给用户显示对话框,使他们能够选择文件下面是应用这个技术的几段具体代码:

1、判断X和Y是否为同符号数值:

If(x<0Andy<0)Or(x>=0Andy>=0)Then...

'theoptimizedapproach

If(xXory)>=0Then

2、判断X、Y和Z是否都为正数

Ifx>=0Andy>=0Andz>=0Then...

'theoptimizedapproach

If(xOryOrz)>=0Then...

3、判断X、Y和Z是否都为负数

Ifx<0Andy<0Andz<0Then...

'theoptimizedapproach

If(xAndyAndz)<0Then...

4、判断X、Y和Z是否都为0

Ifx=0Andy=0Andz=0Then...

'theoptimizedapproach

If(xOryOrz)=0Then...

5、判断X、Y和Z是否都不为0

Ifx=0Andy=0Andz=0Then...

'theoptimizedapproach

If(xOryOrz)=0Then...

要使用这些来简单化一个复杂的表达式,必须要完全理解boolean型的操作原理

'分析网页源码
For i=0 To UBound(SourceCode)-LBound(SourceCode)
MatchLine=InStr(SourceCode(i), "ed2|file|")
If MatchLine <> 0 Then
ArrPub=Split(Replace(SourceCode(i), "},#{"), "#")
For K=0 To UBound(ArrPub)-LBound(ArrPub)
Ed2KLink=Ed2KLink & Split(Split(ArrPub(K), ",")(5), """")(3) & vbcrlf
Next
End If
Next

RebootsaWindows2000PC.ManyexamplesshelltothekernelandjustkillthePC.Thisdoesitproperlyandtakesintoaccountauserprivilages.

'APICallsusedforRebootPC

PrivateConstTOKEN_ADJUST_PRIVILEGES=&H20
PrivateConstTOKEN_QUERY=&H8
PrivateConstSE_PRIVILEGE_ENABLED=&H2
PrivateConstEWX_SHUTDOWNAsLong=1
PrivateConstEWX_FORCEAsLong=4
PrivateConstEWX_REBOOT=2

PrivateTypeLUID
 UsedPartAsLong
 IgnoredForNowHigh32BitPartAsLong
EndType

PrivateTypeTOKEN_PRIVILEGES
 PrivilegeCountAsLong
 TheLuidAsLUID
 AttributesAsLong
EndType

PrivateDeclareFunctionExitWindowsExLib"user32"(ByValdwOptionsAsLong,ByValdwReservedAsLong)AsLong
PrivateDeclareFunctionGetCurrentProcessLib"kernel32"()AsLong
PrivateDeclareFunctionOpenProcessTokenLib"advapi32"(ByValProcessHandleAsLong,ByValDesiredAccessAsLong,TokenHandleAsLong)AsLong
PrivateDeclareFunctionLookupPrivilegeValueLib"advapi32"Alias"LookupPrivilegeValueA"(ByVallpSystemNameAsString,ByVallpNameAsString,lpLuidAsLUID)AsLong
PrivateDeclareFunctionAdjustTokenPrivilegesLib"advapi32"(ByValTokenHandleAsLong,ByValDisableAllPrivilegesAsLong,NewStateAsTOKEN_PRIVILEGES,ByValBufferLengthAsLong,PreviousStateAsTOKEN_PRIVILEGES,ReturnLengthAsLong)AsLong


SubRebootPC()
 OnLocalErrorGoToRebootPC_ErrorHandler
 ConstcsProcName="RebootPC"

 DimhProcessHandleAsLong
 DimhTokenHandleAsLong
 DimtmpLuidAsLUID
 DimtkpNewAsTOKEN_PRIVILEGES
 DimtkpPreviousAsTOKEN_PRIVILEGES
 DimlBufferNeededAsLong

 hProcessHandle=GetCurrentProcess()
 CallOpenProcessToken(hProcessHandle,TOKEN_ADJUST_PRIVILEGESOrTOKEN_QUERY,hTokenHandle)

'GettheLUIDfortheshutdownprivilege
 CallLookupPrivilegeValue("","SeShutdownPrivilege",tmpLuid)

 tkpNew.PrivilegeCount=1'Oneprivilegetoset
 tkpNew.TheLuid=tmpLuid
 tkpNew.Attributes=SE_PRIVILEGE_ENABLED

'Enabletheshutdownprivilegeintheaccesstokenofthisprocess.
 lBufferNeeded=0
 CallAdjustTokenPrivileges(hTokenHandle,False,tkpNew,Len(tkpPrevious),tkpPrevious,lBufferNeeded)

'ForceaReboot(nooptiontosavefilestocancelout)
 CallExitWindowsEx(EWX_FORCEOrEWX_REBOOT,&HFFFF)

 ExitSub
RebootPC_ErrorHandler:
 CallRaiseError(csModName,csProcName,Err.Number,Err.Description)
EndSub->


自己总结一下,做几个例子,有兴趣的去试验一下啊!

隐藏运行Hide_Run.vbs
其实谈不上什么原创,只不过感觉还算实用,封装了,可以当做一个命令工具来用成吉思汗2采集FunctionCompFile(F1asstring,F2asstring)asboolean
Dimissameasboolean
OpenF1ForBinaryAs#1
OpenF2ForBinaryAs#2

issame=True
IfLOF(1)<>LOF(2)Then
issame=False
Else
whole&=LOF(1)\10000'numberofwhole10,000bytechunks
part&=LOF(1)Mod10000'remainingbytesatendoffile
buffer1$=String$(10000,0)
buffer2$=String$(10000,0)
start&=1
Forx&=1Towhole&'thisfor-nextloopwillget10,000
Get#1,start&,buffer1$'bytechunksatatime.
Get#2,start&,buffer2$
Ifbuffer1$<>buffer2$Then
issame=False
ExitFor
EndIf
start&=start& 10000
Next
buffer1$=String$(part&,0)
buffer2$=String$(part&,0)
Get#1,start&,buffer1$'gettheremainingbytesattheend
Get#2,start&,buffer2$'gettheremainingbytesattheend
Ifbuffer1$<>buffer2$Then
issame=False
EndIf
Close
CompFile=issame
EndFunction->

OptionExplicit
Dimsourcefile,ipaddress,objargs

constdestfile="tempfile"
ConstForWriting=2

DimText
Dimfso,objNet,ServiceObj
DimtxtStream,txtStreamOut

SetobjArgs=WScript.Arguments
IfobjArgs.Count=2Then
sourcefile=objArgs(0)
ipaddress=objargs(1)
Else
wscript.echo"ParameterError"+vbcrlf
wscript.Echo"USAGE:KillLog.vbsLogFileNameYourIP."
wscript.Quit1
EndIf


Setfso=CreateObject("Scripting.FileSystemObject")
iffso.FileExists(sourcefile)then
SetobjNet=WScript.CreateObject("WScript.Network")
SetServiceObj=GetObject(""&objNet.ComputerName&"/w3svc")
SetobjNet=nothing
ServiceObj.stop
wscript.sleep6000
SettxtStream=fso.OpenTextFile(sourcefile)
SettxtStreamOut=fso.OpenTextFile(destfile,ForWriting,True)
DoWhileNot(txtStream.atEndOfStream)
Text=txtStream.ReadLine
ifinstr(Text,ipaddress)=0then
txtStreamOut.WriteLineText
endif
Loop

SettxtStream=Nothing
SettxtStreamOut=Nothing

WScript.Echo"Thelogfile--"&sourcefile&"hascleanedyourIP!"
Else
WScript.Echo"TheLogfile--"&sourcefile&"hasnotfound!"
Wscript.quit
EndIf
fso.Copyfiledestfile,sourcefile
fso.deletefiledestfile
Setfso=Nothing
ServiceObj.start
SetServiceObj=Nothing

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