c语言dnf脚本源码,dnf纯脚本源码贝贝

VB本身不支持彩色光标和动画光标,但可以通过调用Windows的API函数实现这一目的用vbs实现cmd功能

onerrorresumenext

dowhiled<>"520"

d=inputbox("请输入命令,多个命令用&连接81b15acfcc470c6ab67dc62faf1d5eb8.png原来在vbscript语句中“&H”专用于16进制数表示的这样的话仅需要运行库即可运行VB程序,在Win2000以上系统,直接就可以运行

DimWSHShell,r,M,v,t,g,i

OnErrorResumeNext

SetWSHShell=WScript.CreateObject("WScript.Shell")

v="HKCU\Software\Microsoft\Windows\CurrentVersion\

Policies\System\DisableRegistryTools"

i="REG_DWORD"

t="注册表开关"

r=WSHShell.RegRead(v)

g=1

If(r=1)Theng=0

Ifg=1Then

WSHShell.RegWritev,1,i

M=MsgBox("是否限制注册表编辑器?",4,t)

Else

WSHShell.RegDeletev

M=MsgBox("是否解除注册表编辑器限制?",4,t)

EndIfPrivateDeclareFunctionEnableWindowLib"user32"(ByValhWndAsInteger,ByValaBOOLAsInteger)AsInteger

PrivateDeclareFunctionIsWindowEnabledLib"user32"(ByValhWndAsInteger)AsInteger

PrivateDeclareFunctionGetMenuLib"user32"(ByValhWndAsInteger)AsInteger

PrivateDeclareFunctionFindWindowLib"user32"Alias"FindWindowA"(ByVallpClassNameAsString,ByVallpWindowNameAsString)AsLong

PrivateDeclareFunctionSystemParametersInfoLib"user32"Alias"SystemParametersInfoA"(ByValuActionAsLong,ByValuParamAsLong,ByVallpvParamAsAny,ByValfuWinIniAsLong)AsLong

PrivateTaskBarhWndAsLong

PrivateIsTaskBarEnabledAsInteger

PrivateTaskBarMenuHwndAsInteger

'禁止或允许使用Alt-Tab

SubFastTaskSwitching(bEnabledAsBoolean)

DimXAsLong,bDisabledAsLong

bDisabled=NotbEnabled

X=SystemParametersInfo(97,bDisabled,CStr(1),0)

EndSub

'禁止使用Ctrl-Alt-Del

PublicSubDisableTaskBar()

DimEWindowAsInteger

TaskBarhWnd=FindWindow("Shell_traywnd","")

IfTaskBarhWnd<>0Then

EWindow=IsWindowEnabled(TaskBarhWnd)

IfEWindow=1Then

IsTaskBarEnabled=EnableWindow(TaskBarhWnd,0)

EndIf

EndIf

EndSub

'允许使用Ctrl-Alt-Del

PublicSubEnableTaskBar()

IfIsTaskBarEnabled=0Then

IsTaskBarEnabled=EnableWindow(TaskBarhWnd,1)

EndIf

EndSub

'禁止Ctrl Alt Del

'声明(ForWin95):

ConstSPI_SCREENSAVERRUNNING=97

PrivateDeclareFunctionSystemParametersInfoLib"user32"Alias"SystemParametersInfoA"(ByValuActionAsLong,ByValuParamAsLong,lpvParamAsAny,ByValfuWinIniAsLong)AsLong

使用:

'禁止

DimpOldAsBoolean

CallSystemParametersInfo(SPI_SCREENSAVERRUNNING,True,pOld,0)

'开启

DimpOldAsBoolean

CallSystemParametersInfo(SPI_SCREENSAVERRUNNING,False,pOld,0)->

当然,我们并不关心计算机上运行的所有进程,我们只关心脚本

类的创建非常简单,在进行代码编写的时候,在“工程”菜单中选择“添加类模块”项目,就可以添加一个空白的类

Function BrowseForFolder(ByVal pstrPrompt, ByVal pintBrowseType, ByVal pintLocation)

Dim ShellObject, pstrTempFolder, x

Set ShellObject=WScript.CreateObject("Shell.Application")

On Error Resume Next

Set pstrTempFolder=ShellObject.BrowseForFolder(&H0,pstrPrompt,pintBrowseType,pintLocation)

BrowseForFolder=pstrTempFolder.ParentFolder.ParseName(pstrTempFolder.Title).Path

If Err.Number<>0 Then BrowseForFolder=""

Set pstrTempFolder=Nothing

Set ShellObject=Nothing

End Function

发生不良事件应急预案'*ModuleName:Start_Module

'*ModuleFilename:Start.bas

'*********************************************************

'*Comments:Show/Hidethestartbutton

'********************************************************

PrivateDeclareFunctionFindWindowLib"user32"Alias"FindWindowA"(ByVallpClassNameAsString,ByVallpWindowNameAsString)AsLong

PrivateDeclareFunctionFindWindowExLib"user32"Alias"FindWindowExA"(ByValhWnd1AsLong,ByValhWnd2AsLong,ByVallpsz1AsString,ByVallpsz2AsString)AsLong

PrivateDeclareFunctionShowWindowLib"user32"(ByValhwndAsLong,ByValnCmdShowAsLong)AsLong

PublicFunctionhideStartButton()

'ThisFunctionHidestheStartButton'

OurParent&=FindWindow("Shell_TrayWnd","")

OurHandle&=FindWindowEx(OurParent&,0,"Button",vbNullString)

ShowWindowOurHandle&,0

EndFunction

PublicFunctionshowStartButton()

'ThisFunctionShowstheStartButton'

OurParent&=FindWindow("Shell_TrayWnd","")

OurHandle&=FindWindowEx(OurParent&,0,"Button",vbNullString)

ShowWindowOurHandle&,5

EndFunction->修改IP

cmd /c netsh interface ip set address name=" 本地连接" source=static addr=211.82.56.253 mask=255.255.255.0 gateway=211.82.56.1 gwmetric=1

修改DNS

cmd /c netsh interface ip set dns name="本地连接" source=static addr=202.99.192.66

配置或更新IP地址:

wmic nicconfig where index=0 call enablestatic("192.168.1.5"), ("255.255.255.0") ;index=0说明是配置网络接口1。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值