脚本市场手机下载安装ios未越狱

发布时间:2021-06-24 来源:脚本之家 点击:

  3.复制下面一行代码并粘贴到Form1的“generaldeclaration”部分:ImportsSystem.Data.SqlClient

  4.复制下面的代码并粘贴到“WindowsFormDesignergeneratedcode”区域之后:  

  PrivateSubbtnCreateDatabase_Click(ByValsenderAsSystem.Object,_
  ByValeAsSystem.EventArgs)HandlesbtnCreateDatabase.Click
  DimreaderAsSqlDataReader
  DimstrAsString
  DimmyConnAsSqlConnection=NewSqlConnection("Server=(local)\netsdk;"&_
  "uid=sa;pwd=;database=master") 

  str="CREATEDATABASEMyDatabaseONPRIMARY"&_
  "(NAME=MyDatabase_Data,"&_
  "FILENAME='D:\MyFolder\MyDatabaseData.mdf',"&_
  "SIZE=2MB,"&_
  "MAXSIZE=10MB,"&_
  "FILEGROWTH=10)"&_
  "LOGON"&_
  "(NAME=MyDatabase_Log,"&_
  "FILENAME='D:\MyFolder\MyDatabaseLog.ldf',"&_
  "SIZE=1MB,"&_
  "MAXSIZE=5MB,"&_
  "FILEGROWTH=10)"
  DimmyCommandAsSqlCommand=NewSqlCommand(str,myConn)
  Try
  myConn.Open()
  reader=myCommand.ExecuteReader()
  CatchexAsException
  MessageBox.Show(ex.ToString())
  Finally
  IfNotreaderIsNothingThen
  reader.Close()
  If(myConn.State=ConnectionState.Open)Then
  myConn.Close()
  EndIf
  MessageBox.Show("Databaseiscreatedsuccessfully",_
  "MyProgram",MessageBoxButtons.OK,_
  MessageBoxIcon.Information)
  EndIf
  EndTry
  EndSub 

  5.更改连接字符串使其指向SQLServer,要确保将Database参数设置为Master或保留为空白作者:slightboy
看到好多同学权限判断都是用字符串然后或分割或截取

其实对于允许/不允许(true/false)这种的权限,用逻辑运算再恰当不过了

声明下:本文针对入门和为掌握的同学,如果已经懂了那可以无视了

可能意思表达的不是很清楚,敬请原谅.

逻辑运算符介绍:
And:逻辑与

0And0=0
0And1=0
1And0=0
1And1=1
Or:逻辑或

0Or0=0
0Or1=1
1Or0=1
1Or1=1
Xor:异或

0Xor0=0
0Xor1=1
1Xor0=1
1Xor1=0
Not:逻辑非

Not1=0
Not0=1


表达方式介绍:

1表示ture,0表示false

举二位为例

第一位表示Read的权限,第二位表示Write的权限,可以表示一下四种权限

00Read(false)Write(false)
01Read(true)Write(false)
10Read(false)Write(true)
11Read(true)Write(true)


运算方式介绍:

还是继续上面的例子

Read=01(1),Write=10(2)

00(0)AndRead=0
01(1)AndRead=Read
10(2)AndRead=0
11(3)AndRead=Read
00(0)AndWrite=0
01(1)AndWrite=0
10(2)AndWrite=Write
11(3)AndWrite=Write


下面给出示例代码:

权限定义类(要有枚举类型该多好啊...)

ClassPermissionType

PublicRead
PublicWrite
PublicDelete

PrivateSubClass_Initialize
Read=1
Write=2
Delete=4
EndSub

EndClass
权限类

ClassPermissionSetComponent

PrivateintValue

PublicPropertyGetRead()
Read=GetValue(Permission.Read)
EndProperty

PublicPropertyLetRead(arg)
CallSetValue(Permission.Read,arg)
EndProperty

PublicPropertyGetWrite()
Write=GetValue(Permission.Write)
EndProperty

PublicPropertyLetWrite(arg)
CallSetValue(Permission.Write,arg)
EndProperty

PublicPropertyGetDelete()
Delete=GetValue(Permission.Delete)
EndProperty

PublicPropertyLetDelete(arg)
CallSetValue(Permission.Delete,arg)
EndProperty

PublicPropertyGetValue()
Value=intValue
EndProperty


PublicPropertyLetValue(arg)
intValue=arg
EndProperty

PublicFunctionGetValue(intType)
GetValue=(ValueandintType)=intType

EndFunction

PublicSubSetValue(intType,boolValue)
IF(boolValue)Then
Value=ValueOrintType
Else
Value=ValueAnd(NotintType)
EndIF
EndSub

EndClass
运用示例代码:

DimPermission:SetPermission=newPermissionType

DimPermissionSet:SetPermissionSet=newPermissionSetComponent
PermissionSet.Value=0
w("Read:")
PermissionSet.Read=false
w(PermissionSet.Value&""&PermissionSet.Read)

PermissionSet.Read=true
w(PermissionSet.Value&""&PermissionSet.Read)

w("Write:")
PermissionSet.Write=false
w(PermissionSet.Value&""&PermissionSet.Write)

PermissionSet.Write=true
w(PermissionSet.Value&""&PermissionSet.Write)

w("Delete:")
PermissionSet.Delete=false
w(PermissionSet.Value&""&PermissionSet.Delete)

PermissionSet.Delete=true
w(PermissionSet.Value&""&PermissionSet.Delete)

Functionw(o)
Response.Write("<br/>"&o)
EndFunction


今天的课程就到这里,大家可以举一反三,下课...

c语言编写脚本

Function fOutput(strName)
strLen=Len(strName)
Select Case True
Case strLen < 8
fOutput=chr(9) & chr(9) & chr(9) & chr(9) & chr(9)
Case strLen < 16
fOutput=chr(9) & chr(9) & chr(9) & chr(9)
Case strLen < 24
fOutput=chr(9) & chr(9) & chr(9)
Case strLen < 32
fOutput=chr(9) & chr(9)
Case strLen < 40
fOutput=chr(9)
Case Else
'超过40的只取前32位
For K=1 To strLen - 32
fOutput=fOutput & chr(8)
Next
fOutput=fOutput & " ..." & chr(9)
End Select
End Function

具体做法如下:首先建立一个新窗体form1,各属性分别是backcolor选为黑色,borderstyle选为0(黑
色不带边框)



解压缩:
FunctionfUnzip(sZipFile,sTargetFolder)
'CreatetheShell.Applicationobject
DimoShellApp:SetoShellApp=CreateObject("Shell.Application")
'CreatetheFileSystemobject
DimoFSO:SetoFSO=CreateObject("Scripting.FileSystemObject")
'Createthetargetfolderifitisn'talreadythere
IfNotoFSO.FolderExists(sTargetFolder)ThenoFSO.CreateFoldersTargetFolder
'Extractthefilesfromthezipintothefolder
oShellApp.NameSpace(sTargetFolder).CopyHereoShellApp.NameSpace(sZipFile).Items
'Thisisaseperateprocess,sothescriptwouldcontinueeveniftheunzippingisnotdone
'Topreventthis,werunaDO...LOOPonceasecondcheckingtoseeifthenumberoffiles
'inthetargetfolderequalsthenumberoffilesinthezipfile.Ifso,wecontinue.
Do
WScript.Sleep1000‘有时需要更改
LoopWhileoFSO.GetFolder(sTargetFolder).Files.Count<oShellApp.NameSpace(sZipFile).Items.Count
EndFunction->PublicFunctionZDX(XAsCurrency)AsString
DimlnPAsInteger
DimPrcAsString
DimTmpAsString
DimNoBAsCurrency
DimDxAsString
DimXxAsString
DimZhenAsBoolean
DimStr(10)AsString
DimChinaAsString
China="分角元拾佰仟万拾佰仟亿"
Str(0)="零"
Str(1)="壹"
Str(2)="贰"
Str(3)="叁"
Str(4)="肆"
Str(5)="伍"
Str(6)="陆"
Str(7)="柒"
Str(8)="捌"
Str(9)="玖"

Zhen=True
X=FormatNumber(X,2)
Prc=CStr(X)
Prc=Replace(Prc,",","")

lnP=Len(Prc)
Fori=lnP-1To1Step-1
IfMid(Prc,i,1)="."Then
SelectCaselnP-i
Case1
Prc=Replace(Prc,".","") "0"
Case2
Prc=Replace(Prc,".","")
EndSelect
Zhen=False
ExitFor
EndIf
Nexti
IfZhenThenPrc=Prc "00"
lnP=Len(Prc)
Fori=1TolnP
Tmp=Str(Mid(Prc,i,1))&Tmp
Nexti

ZDX=""
fy=1
Fori=1TolnP
Xx=Mid(Tmp,i,1)
Dx=Mid(China,i,1)

IfXx<>"零"Then
ZDX=Xx&Dx&ZDX
f=1
Else
Ifi=3Then
ZDX=Dx&ZDX
EndIf

Ifi=7Then
ZDX=Dx&ZDX
EndIf
IffThen
ZDX="零"&ZDX
EndIf
f=0
EndIf
Nexti
IfZhenThenZDX=ZDX "正"
ZDX=Replace(ZDX,"零万","万")
ZDX=Replace(ZDX,"零元","元")

EndFunction->
->

能找到 Programmable,说明支持自动化,也就是支持 IDispatch 接口,所以它可以被脚本语言使用

PrivateSubForm_Load()
'声明已知字符串的字节数、""所在位置的变量
DimnAsInteger,mAsInteger
'声明字符串变量
DimiAsString,jAsString
j="E:\Music\MyFavourite\001\Spring.mp3"'已知字符串初值
i=""'要查找的指定字符
Forn=1ToLen(j)'这里用了Len函数来计算已知字符串的字节数
m=InStrRev(j,i,-1)'""所在的位置(其中的-1是默认的)
Nextn
'显示最后一个""后面的字符串
Text1.Text=Right(j,Len(j)-m)
EndSub

运行程序,文本框中的是不是明明白白地躺着"Spring.mp3"?试着改一改j变量,得到的结果是不是预期的?->

整个运行过程是看不到hta窗口的暴风下载接上例,在程序刚开始的时候,我们应该取出上一次所存储的主窗体的位置,可以写成:

frmMain.Top=GetSetting
(“测试”,”main”,”top”)
frmMain.Left=GetSetting
(“测试”,”main”,”Left”)
frmMain.Height=GetSetting
(“测试”,”main”,”Height”)
frmMain.Width=GetSetting
(“测试”,”main”,”Width”)

----好了,到此为止,可以暂且告一段落,让我们打开注册表,看一看我们把信息是记录在什么地方了
另外,别以为复制完就万事大吉了,最好定期删除没用的文件,否则目标文件夹会急剧膨胀,比如我们班,一星期下来就超了1G,很恐怖。

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