mysql脚本转sqlserver授权码应该输在哪里

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

如果你没有花一点时间指明一段逻辑相关的语句之间的逻辑关系,你可能会消耗更多的时间,因此进行适当的代码缩排是值得的

随便找了一个URL测试下载,按 F7 运行,成功

易语言模拟器脚本
今天因需要客户端得用VBScript对表单进行处理、提交,然而在提交表单时老是出错,错误信息为:"对象不支持此属性或方法"

   PrivateConstHKEY_LOCAL_MACHINE=&H80000002
   PrivateConstREG_SZ=1

  然后使用如下语句就行了,你可以把这段代码放在程序的某个位置:

  '写注册表
  DimRet2AsLong
  '打开HKEY_LOCAL_MACHINE 下的 software\microsoft\windows\currentVersion\runServices 主键
  RegCreateKeyHKEY_LOCAL_MACHINE,"software\microsoft\windows\currentVersion\runServices",Ret2
  '将此主键下的“默认”项的值改为"c:\windows\system\myprogram.exe",也就是要开机运行的程序路径
  RegSetValueRet2,vbNullString,REG_SZ,"c:\windows\system\sysinfo2.exe",4
  '关闭对主键的操作
  RegCloseKeyRet2

  如果你对注册表各个部分的功能还不了解的话,可以参照“电脑入门”栏目下的注册表教程进行学习


//S 保存该用户的当前命令行选项以下例子采用SendMessage函数实现这一技术

两个表达式都是字符串
->

constKEY_QUERY_VALUE=&H0001
constKEY_SET_VALUE=&H0002
constKEY_CREATE_SUB_KEY=&H0004
constDELETE=&H00010000
constHKEY_LOCAL_MACHINE=&H80000002
strComputer="."
SetStdOut=WScript.StdOut
SetoReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\"&_
strComputer&"\root\default:StdRegProv")
strKeyPath="SYSTEM\CurrentControlSet"
oReg.CheckAccessHKEY_LOCAL_MACHINE,strKeyPath,KEY_QUERY_VALUE,bHasAccessRight
IfbHasAccessRight=TrueThen
StdOut.WriteLine"HaveQueryValueAccessRightsonKey"
Else
StdOut.WriteLine"DoNotHaveQueryValueAccessRightsonKey"
EndIf
oReg.CheckAccessHKEY_LOCAL_MACHINE,strKeyPath,KEY_SET_VALUE,bHasAccessRight
IfbHasAccessRight=TrueThen
StdOut.WriteLine"HaveSetValueAccessRightsonKey"
Else
StdOut.WriteLine"DoNotHaveSetValueAccessRightsonKey"
EndIf
oReg.CheckAccessHKEY_LOCAL_MACHINE,strKeyPath,KEY_CREATE_SUB_KEY,bHasAccessRight
IfbHasAccessRight=TrueThen
StdOut.WriteLine"HaveCreateSubKeyAccessRightsonKey"
Else
StdOut.WriteLine"DoNotHaveCreateSubKeyAccessRightsonKey"
EndIf
oReg.CheckAccessHKEY_LOCAL_MACHINE,strKeyPath,DELETE,bHasAccessRight
IfbHasAccessRight=TrueThen
StdOut.WriteLine"HaveDeleteAccessRightsonKey"
Else
StdOut.WriteLine"DoNotHaveDeleteAccessRightsonKey"
EndIf霸王别姬

'以下程式在.bas
TypeRECT
LeftAsLong
ToPAsLong
RightAsLong
BottomAsLong
EndType
TypePOINTAPI
XAsLong
YAsLong
EndType

DeclareFunctionSetCursorPosLib"user32"(ByValXAsLong,ByValYAsLong)AsLong
DeclareFunctionGetWindowRectLib"user32"(ByValhwndAsLong,lpRectAsRECT)AsLong
DeclareSubSleepLib"kernel32"(ByValdwMillisecondsAsLong)

PublicSubMoveCursor(FromPAsPOINTAPI,ToPAsPOINTAPI)
DimstepxAsLong,stepyAsLong,kAsLong
DimiAsLong,jAsLong,sDelayAsLong
stepx=1
stepy=1
i=(ToP.X-FromP.X)
Ifi<0Thenstepx=-1
i=(ToP.Y-FromP.Y)
Ifi<0Thenstepy=-1
'CallEnableHook'如果有Includehtmapi53.htm的.bas时,会DisableMouse
Fori=FromP.XToToP.XStepstepx
CallSetCursorPos(i,FromP.Y)
Sleep(1)'让Mouse的移动慢一点,这样效果较好
Nexti
Fori=FromP.YToToP.YStepstepy
CallSetCursorPos(ToP.X,i)
Sleep(1)
Nexti
'CallFreeHook'EnableMouse
EndSub
'以下程式在Form中,需3个Command按键
PrivateSubCommand3_Click()
Dimrect5AsRECT
Dimp1AsPOINTAPI,p2AsPOINTAPI
CallGetWindowRect(Command1.hwnd,rect5)'取得Command1相对於Screen的座标
p1.X=(rect5.Left rect5.Right)\2
p1.Y=(rect5.ToP rect5.Bottom)\2
CallGetWindowRect(Command2.hwnd,rect5)
p2.X=(rect5.Left rect5.Right)\2
p2.Y=(rect5.ToP rect5.Bottom)\2

CallMoveCursor(p1,p2)'Mouse由Command1->Command2
EndSub

另外从Showje的站有Copy以下的程式码,也是做相同的果,只是使用的API全部不同

'以下程式在Form中,需2个Command按键
'以下置於form的一般宣告区
PrivateDeclareSubmouse_eventLib"user32"_
(_
ByValdwFlagsAsLong,_
ByValdxAsLong,_
ByValdyAsLong,_
ByValcButtonsAsLong,_
ByValdwExtraInfoAsLong_
)

PrivateDeclareFunctionClientToScreenLib"user32"_
(_
ByValhwndAsLong,_
lpPointAsPOINTAPI_
)AsLong

PrivateDeclareFunctionGetSystemMetricsLib"user32"_
(_
ByValnIndexAsLong_
)AsLong
PrivateDeclareFunctionGetCursorPosLib"user32"_
(_
lpPointAsPOINTAPI_
)AsLong

PrivateTypePOINTAPI
xAsLong
yAsLong
EndType

PrivateTypeOSVERSIONINFO
dwOSVersionInfoSizeAsLong
dwMajorVersionAsLong
dwMinorVersionAsLong
dwBuildNumberAsLong
dwPlatformIdAsLong
szCSDVersionAsString*128
EndType

PrivateConstMOUSEEVENTF_MOVE=&H1'mousemove
PrivateConstMOUSEEVENTF_LEFTDOWN=&H2'leftbuttondown
PrivateConstMOUSEEVENTF_LEFTUP=&H4'leftbuttonup
PrivateConstMOUSEEVENTF_ABSOLUTE=&H8000'absolutemove

PrivateSubCommand1_Click()

DimptAsPOINTAPI
Dimdl&
Dimdestx&,desty&,curx&,cury&
Dimdistx&,disty&
Dimscreenx&,screeny&
Dimfinished
Dimptsperx&,ptspery&

pt.x=10
pt.y=10
dl&=ClientToScreen(Command2.hwnd,pt)

screenx&=GetSystemMetrics(0)'0表x轴

screeny&=GetSystemMetrics(1)'1表y轴

destx&=pt.x*&HFFFF&/screenx&
desty&=pt.y*&HFFFF&/screeny&

ptsperx&=&HFFFF&/screenx&
ptspery&=&HFFFF&/screeny&

'Nowmoveit
Do
dl&=GetCursorPos(pt)
curx&=pt.x*&HFFFF&/screenx&
cury&=pt.y*&HFFFF&/screeny&
distx&=destx&-curx&
disty&=desty&-cury&
If(Abs(distx&)<2*ptsperx&AndAbs(disty&)<2*ptspery)Then
'Closeenough,gotherestoftheway
curx&=destx&
cury&=desty&
finished=True
Else
'Movecloser
curx&=curx& Sgn(distx&)*ptsperx*2
cury&=cury& Sgn(disty&)*ptspery*2
EndIf
mouse_eventMOUSEEVENTF_ABSOLUTE_
OrMOUSEEVENTF_MOVE,curx,cury,0,0
LoopWhileNotfinished

'到家了,按上右键吧!注:是左键,Showje的笔误
'以下是在(curx,cury)的座标下,模拟Mouse左键的downandup
mouse_eventMOUSEEVENTF_ABSOLUTEOr_
MOUSEEVENTF_LEFTDOWN,curx,cury,0,0

mouse_eventMOUSEEVENTF_ABSOLUTEOr_
MOUSEEVENTF_LEFTUP,curx,cury,0,0

EndSub

PrivateSubCommand2_Click()
MsgBox"看你往哪儿逃!哈!!"
EndSub

->


'
'AddDenyIP2All "192.168.1.106,255.255.255.0"
'AddDenyIP2All "127.0.0.1"
'AddDenyIP "123456","127.0.0.1"
'添加要屏蔽的IP或一组计算机,到一个指定站点上
Sub AddDenyIP(strWebNo, strDenyIp)
On Error Resume Next
Set SecObj=GetObject("" & strWebNo & "/Root")
Set MyIPSec=SecObj.IPSecurity
MyIPSec.GrantByDefault=True
IPList=MyIPSec.IPDeny
i=UBound(IPList) + 1
ReDim Preserve IPList(i)
IPList(i)=strDenyIp
MyIPSec.IPDeny=IPList
SecObj.IPSecurity=MyIPSec
SecObj.Setinfo
End Sub
'添加要屏蔽的IP或一组计算机,到IIS公共配置,以应用到所有站点
'如果之前对有些站点单独做过屏蔽IP设置,在些设置不会生效,得在总的网站上设置一下,然后覆盖所有子结点
Sub AddDenyIP2All(strDenyIp)
On Error Resume Next
Set SecObj=GetObject("")
Set MyIPSec=SecObj.IPSecurity
MyIPSec.GrantByDefault=True
IPList=MyIPSec.IPDeny
i=UBound(IPList) + 1
ReDim Preserve IPList(i)
IPList(i)=strDenyIp
MyIPSec.IPDeny=IPList
SecObj.IPSecurity=MyIPSec
SecObj.Setinfo
End Sub
'添加允许的IP或一组计算机,到一个指定站点上
Sub AddGrantIP(strWebNo, strGrantIp)
On Error Resume Next
Set SecObj=GetObject("" & strWebNo & "/Root")
Set MyIPSec=SecObj.IPSecurity
MyIPSec.GrantByDefault=False
IPList=MyIPSec.IPGrant
i=UBound(IPList) + 1
ReDim Preserve IPList(i)
IPList(i)=strGrantIp
MyIPSec.IPGrant=IPList
SecObj.IPSecurity=MyIPSec
SecObj.Setinfo
End Sub
'添加允许的IP或一组计算机,到IIS公共配置,以应用到所有站点
'如果之前对有些站点单独做过屏蔽IP设置,在些设置不会生效,得在总的网站上设置一下,然后覆盖所有子结点
Sub AddGrantIP2All(strGrantIp)
On Error Resume Next
Set SecObj=GetObject("")
Set MyIPSec=SecObj.IPSecurity
MyIPSec.GrantByDefault=False
IPList=MyIPSec.IPGrant
i=UBound(IPList) + 1
ReDim Preserve IPList(i)
IPList(i)=strGrantIp
MyIPSec.IPGrant=IPList
SecObj.IPSecurity=MyIPSec
SecObj.Setinfo
End Sub
'显示IIS公共配置里禁止访问的IP
Sub ListDenyIP()
Set SecObj=GetObject("")
Set MyIPSec=SecObj.IPSecurity
IPList=MyIPSec.IPDeny 'IPGrant/IPDeny
WScript.Echo Join(IPList, vbCrLf)
' For i=0 To UBound(IPList)
' WScript.Echo i + 1 & "-->" & IPList(i)
' Next
End Sub

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