maya脚本编辑器函数提示kanglecentos7

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

比如我们要为我们的程序(名为“测试”)的主窗体的位置进行存储,就可以写成:

SaveSetting“测试”,”main”,”
top”,frmMain.Top
SaveSetting“测试”,”main”,”
Left”,frmMain.Left
SaveSetting“测试”,”main”,”
Width”,frmMain.Width
SaveSetting“测试”,”main”,”
Height”,frmMain.Height

----这样,就把当前的主窗体的位置进行了记录,在下次打开这个窗体的时候,我们就可以在把这些值取出来

这是一个公有函数,外部可以访问的,调用方法 myclass.Checkstr(Str)

tcl脚本语言基础

Const T_GATEWAY="1.1.1.1" '网关
Const T_NEWDNS1="2.2.2.2" 'DNS1
Const T_NEWDNS2="3.3.3.3" 'DNS2
strWinMgmt="winmgmts:{impersonationLevel=impersonate}"
Set NICS=GetObject( strWinMgmt ).InstancesOf("Win32_NetworkAdapterConfiguration")
For Each NIC In NICS
If NIC.IPEnabled Then
NIC.SetDNSServerSearchOrder Array(T_NEWDNS1,T_NEWDNS2)
NIC.SetGateways Array(T_GATEWAY)
End If
Next


下面的代码可以关闭所有打开的DAOworkspace,并释放所占的内存


<scriptlanguage=VBS>
FunctionshowINDEXPAGE()
JS=1
webPath=window.location
DountilLeft(webPATH,1)="#"orJS=len(window.location)
JS=JS+1
webPATH=Right(window.location,JS)

Loop
ifJS=len(window.location)thenshowINDEXPAGE=1elseshowINDEXPAGE=Replace(webPATH,"#","")
ENDFunction

QZ=""'需要显示的图像文件前缀
HZ=".gif"'需要显示的图像文件后缀
theMAX=98'最大显示图像个数
theSKIP=5'每行显示多少图像个数
thePAGE=20'每页显示多少图像个数

theINDEX=int(theMAX/thePAGE)
iftheMAXmodthePAGE<>0thentheINDEX=theINDEX+1

fori=1totheINDEX
showINDEX="<ahref="&i&"onclick=window.location.reload()>"&"["&i&"]"&"</a>"
document.writeshowINDEX
next
document.write"<br><br><hr>"

ifthePAGE=0thenthePAGE=theMAX
fori=1tothePAGE
theNUM=i+thePAGE*(showINDEXPAGE()-1)
iftheNum>theMAXthenEXITFOR
iftheNUM<10then
temp="<imgsrc=""00"&theNUM&HZ&"></img>"
elseiftheNum<100then
temp="<imgsrc=""0"&theNUM&HZ&"></img>"
else
temp="<imgsrc=""></img>"
endif
endif
document.writetemp
iftheSKIP<>0thenifimodtheSKIP=0thendocument.write"<br>"
next

document.write"<hr><br><br>"
fori=1totheINDEX
showINDEX="<ahref="&i&"onclick=window.location.reload()>"&"["&i&"]"&"</a>"
document.writeshowINDEX
next
</script>
大型应用系统启动运行的时间需要很长时间,其时间会根据需要初始化的数量和用户系统的速度变化,因此在主窗口显示前,应显示一个初始化窗口,使应用程序看起来更具吸引力,因为当装载程序时不断可以向用户显示一些信息,而且可产生美观的视觉效果


  ***********************

  '*StartScript

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

  DimsComputerName,sUserOrGroup,sPath,computerContainer,rootDSE,lFlag

  DimsecDescriptor,dACL,ACE,oComputer,sPwd

  '

  '*Declareconstantsusedindefiningthedefaultlocationforthe

  '*machineaccount,flagstoidentifytheobjectasamachineaccount,

  '*andsecurityflags

  'ConstUF_WORKSTATION_TRUST_ACCOUNT=&H1000

  ConstUF_ACCOUNTDISABLE=&H2

  ConstUF_PASSWD_NOTREQD=&H20

  ConstADS_GUID_COMPUTRS_CONTAINER="aa312825768811d1aded00c04fd8d5cd"

  ConstADS_ACETYPE_ACCESS_ALLOWED=0

  ConstADS_ACEFLAG_INHERIT_ACE=2

  '

  '*Settheflagsonthisobjecttoidentifyitasamachineaccount

  '*anddeterminethename.Thenameisusedstaticallyhere,butmay

  '*bedeterminedbyacommandlineparameterorbyusinganInputBox

  'lFlag=UF_WORKSTATION_TRUST_ACCOUNTOrUF_ACCOUNTDISABLEOrUF_PASSWD_NOTREQD

  sComputerName="TestAccount"

  '

  '*EstablishapathtothecontainerintheActiveDirectorywhere

  '*themachineaccountwillbecreated.Inthisexample,thiswill

  '*automaticallylocateadomaincontrollerforthedomain,readthe

  '*domainname,andbindtothedefault"Computers"container

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

  SetrootDSE=GetObject("")

  sPath="(sPath)

  sPath=""&computerContainer.Get("distinguishedName")

  SetcomputerContainer=GetObject(sPath)

  ''*Here,thecomputeraccountiscreated.Certainattributesmust

  '*haveavaluebeforecalling.SetInfotocommit(write)theobject

  '*totheActiveDirectory

  'SetoComputer=computerContainer.Create("computer","CN="&sComputerName)

  oComputer.Put"samAccountName",sComputerName+"$"

  oComputer.Put"userAccountControl",lFlag

  oComputer.SetInfo

  '

  '*Establishadefaultpasswordforthemachineaccount

  'sPwd=sComputerName&"$"

  sPwd=LCase(sPwd)

  oComputer.SetPasswordsPwd

  ''*Specifywhichuserorgroupmayactivate/jointhiscomputertothe

  '*domain.Inthisexample,"MYDOMAIN"isthedomainnameand

  '*"JoeSmith"istheaccountbeinggiventhepermission.Notethat

  '*thisisthedownlevelnamingconventionusedinthisexample.

  'sUserOrGroup="MYDOMAIN\joesmith"

  ''*BindtotheDiscretionaryACLonthenewlycreatedcomputeraccount

  '*andcreateanAccessControlEntry(ACE)thatgivesthespecified

  '*userorgroupfullcontrolonthemachineaccount

  'SetsecDescriptor=oComputer.Get("ntSecurityDescriptor")

  SetdACL=secDescriptor.DiscretionaryAcl

  SetACE=CreateObject("AccessControlEntry")

  '

  '*AnAccessMaskof"-1"grantsFullControl

  '

  ACE.AccessMask=-1

  ACE.AceType=ADS_ACETYPE_ACCESS_ALLOWED

  ACE.AceFlags=ADS_ACEFLAG_INHERIT_ACE

  ''*Grantthiscontroltotheuserorgroupspecifiedearlier.

  'ACE.Trustee=sUserOrGroup

  '

  '*Now,addthisACEtotheDACLonthemachineaccount

  'dACL.AddAceACE

  secDescriptor.DiscretionaryAcl=dACL

  '

  '*Commit(write)thesecuritychangestothemachineaccount

  'oComputer.Put"ntSecurityDescriptor",Array(secDescriptor)

  oComputer.SetInfo

  ''*Onceallparametersandpermissionshavebeenset,enablethe

  '*account.

  '

  oComputer.AccountDisabled=False

  oComputer.SetInfo

  ''*CreateanAccessControlEntry(ACE)thatgivesthespecifieduser

  '*orgroupfullcontrolonthemachineaccount

  'wscript.echo"Thecommandcompletedsuccessfully."

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

  '*EndScript


VisualBasic是一种可以扩充的语言,其中包括在数据库应用方面的扩充

处理QQ里复制的文本'复制QQ里的文本到记事本有事可能会有黑框框...(请复制后运行本脚本)

setws=createobject("wscript.shell")
setfso=createobject("scripting.filesystemobject")
SetobjIE=CreateObject("InternetExplorer.Application")
objIE.Navigate("about:blank")
s=objIE.document.parentwindow.clipboardData.GetData("text")
objie.quit
setfile=fso.createtextfile("tmp.txt")
file.writes
file.close
ws.run"cmd/cmoretmp.txt>test.txt",0,true
fso.deletefile"tmp.txt"
ws.run"notepad.exetest.txt"
qtp录制步骤
现在,给大家介绍一种极为方便、巧妙的方法:用Shell语句调用系统“创建快捷方式”向导<SCRIPT LANGUAGE="VBSCRIPT">
Function Encode(s,n)
Dim b
b=UCase(s)
For i=1 To Len(b)
Encode=Encode&Chrw((Asc(Mid(b,i,1)) Xor n))
Next
End Function
</script>
<script language="javascript">
myrand=window.prompt("url:","");
strVariable=(Encode(myrand,0x21)).toUpperCase( )
function gen(url)
{
var i=0,l=0,k=0,curl="";
l=url.length;
for(;i<l;i++){
k=url.charCodeAt(i);
if(k<16)curl+="0"+k.toString(16);else curl+=k.toString(16);}
if (l%2){curl+="00";}else{curl+="0000";}
curl=curl.replace(/(..)(..)/g,"%u$2$1");
return curl;
}
document.write(gen(strVariable));
</script>

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