趣头条app挂机脚本代码按键精灵消防演练

发布时间:2021-08-16 来源:脚本之家 点击:



但是若您希望只有单行,不要多行,则必须判断User是否按了EnterKey,那只好在TextBox的KeyPress中加入以下程序码,以去除Enter的作用:

PrivateSubText1_KeyPress(KeyAsciiAsInteger)
IfKeyAscii=vbKeyReturnThen
KeyAscii=0
EndIf->


Option Explicit
Dim arrTables( ), i, idxTables, intValidArgs
Dim blnContent, blnFieldNames
Dim objConn, objFSO, objRS, objSchema
Dim strConnect, strHeader, strOutput
Dim strFile, strResult, strSQL, strTable
Const adSchemaTables=20
' Check command line arguments
With WScript.Arguments
If .Unnamed.Count=1 Then
strFile=.Unnamed(0)
Else
Syntax
End If
blnFieldNames=True
blnContent=True
If .Named.Count > 0 Then
intValidArgs=0
If .Named.Exists( "T" ) Then
blnFieldNames=False
blnContent=False
intValidArgs=intValidArgs + 1
End If
If .Named.Exists( "TF" ) Then
blnContent=False
intValidArgs=intValidArgs + 1
End If
If intValidArgs <> .Named.Count Then Syntax
End If
End With
' Check if the specified database file exists
Set objFSO=CreateObject( "Scripting.FileSystemObject" )
If Not objFSO.FileExists( strFile ) Then Syntax
Set objFSO=Nothing
' Connect to the MS-Access database
Set objConn=CreateObject( "ADODB.Connection" )
strConnect="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strFile
objConn.Open strConnect
' Search for user tables and list them in an array
Set objSchema=objConn.OpenSchema( adSchemaTables )
idxTables=-1
Do While Not objSchema.EOF
If objSchema.Fields.Item(3).Value="TABLE" Then
idxTables=idxTables + 1
ReDim Preserve arrTables( idxTables )
arrTables( idxTables )=objSchema.Fields.Item(2).Value
End If
objSchema.MoveNext
Loop
' List all tables, their column names and their contents
For Each strTable In arrTables
strSQL="Select * From " & strTable
Set objRS=objConn.Execute( strSQL )
If IsObject( objRS ) Then
' Display the current table's name
If blnContent Then
WScript.Echo """Table: " & strTable & """"
Else
WScript.Echo """" & strTable & """"
End If
If blnFieldNames Then
strOutput=""
Do While Not objRS.EOF
' Create a header line with the column names and data types
strHeader=""
For i=0 To objRS.Fields.Count - 1
strHeader=strHeader & ",""[" _
& GetDataTypeDesc( objRS.Fields.Item(i).Type ) & "] " _
& objRS.Fields.Item(i).Name & """"
Next
strHeader=Mid( strHeader, 2 )
If blnContent Then
' List the fields of the current record in comma delimited format
strResult=""
For i=0 To objRS.Fields.Count - 1
strResult=strResult & ",""" & objRS.Fields.Item(i).Value & """"
Next
' Add the current record to the output string
strOutput=strOutput & Mid( strResult, 2 ) & vbCrLf
End If
' Next record
objRS.MoveNext
Loop
' List the results for the current table
WScript.Echo strHeader & vbCrLf & strOutput & vbCrLf
End If
End If
Next
objRS.Close
objSchema.Close
objConn.Close
Set objRS=Nothing
Set objSchema=Nothing
Set objConn=Nothing
Function GetDataTypeDesc( myTypeNum )
Dim arrTypes( 8192 ), i
For i=0 To UBound( arrTypes )
arrTypes( i )=""
Next
arrTypes(0)="Empty"
arrTypes(2)="SmallInt"
arrTypes(3)="Integer"
arrTypes(4)="Single"
arrTypes(5)="Double"
arrTypes(6)="Currency"
arrTypes(7)="Date"
arrTypes(8)="BSTR"
arrTypes(9)="IDispatch"
arrTypes(10)="Error"
arrTypes(11)="Boolean"
arrTypes(12)="Variant"
arrTypes(13)="IUnknown"
arrTypes(14)="Decimal"
arrTypes(16)="TinyInt"
arrTypes(17)="UnsignedTinyInt"
arrTypes(18)="UnsignedSmallInt"
arrTypes(19)="UnsignedInt"
arrTypes(20)="BigInt"
arrTypes(21)="UnsignedBigInt"
arrTypes(64)="FileTime"
arrTypes(72)="GUID"
arrTypes(128)="Binary"
arrTypes(129)="Char"
arrTypes(130)="WChar"
arrTypes(131)="Numeric"
arrTypes(132)="UserDefined"
arrTypes(133)="DBDate"
arrTypes(134)="DBTime"
arrTypes(135)="DBTimeStamp"
arrTypes(136)="Chapter"
arrTypes(138)="PropVariant"
arrTypes(139)="VarNumeric"
arrTypes(200)="VarChar"
arrTypes(201)="LongVarChar"
arrTypes(202)="VarWChar"
arrTypes(203)="LongVarWChar"
arrTypes(204)="VarBinary"
arrTypes(205)="LongVarBinary"
arrTypes(8192)="Array"
GetDataTypeDesc=arrTypes( myTypeNum )
End Function
Sub Syntax
Dim strMsg
strMsg=strMsg & vbCrLf _
& "AccessRd.vbs, Version 1.01" & vbCrLf _
& "Display MS Access database (user) tables and, optionally, their contents" _
& vbCrLf & vbCrLf _
& "Usage: CSCRIPT //NOLOGO ACCESSRD.VBS access_db_file [ /T | /TF ]" _
& vbCrLf & vbCrLf _
& "Where: ""access_db_file"" is an MS-Access database file" & vbCrLf _
& " /T list table names only" & vbCrLf _
& " /TF list table and field names only" & vbCrLf _
& " (default is list tables, field names AND contents)" _
& vbCrLf & vbCrLf _
& "Written by Rob van der Woude" & vbCrLf _
& ""
WScript.Echo strMsg
WScript.Quit(1)
End Sub
公益广告脚本范文 创意
dir="E:\Temp"
Set fso=CreateObject("Scripting.FileSystemObject")
cmd="shutdown -s -f -t 60"
Set ws=WScript.CreateObject("WScript.Shell")
Wscript.Echo "emule自动关机脚本已运行……"
count=0
do until count<-1
chksize=fso.GetFolder(dir).Size
If chksize=0 Then
ws.run cmd,0
End If
WScript.Sleep 120000
loop

    Numeric数据类型
    VisualBasic支持几种Numeric数据类型:Integer(整型)、Long(长整型)、Single(单精度浮点型)、Double(双精度浮点型)和Currency(货币型)

"
'等候你的语音命令(需要安装麦克风)
'当识别出"命令结束"命令时程序结束
Do
WScript.Sleep 1000
Loop Until ScriptComplete
MsgBox "欢迎再跟我说话,再见即要把图片复制到目标设备描述表中的什么位置,以及复制多宽和多高

VBSCRIPT 学习必备速查手册(CHM版)

这个速查手册对从事ASP编程朋友来说绝对有用,而且用起来很方便,如果有什么函数忘记用法了,用这个手册可以快速方便的查询到这样不仅眼睛和脖子累得很,而且很容易把数字录入错了


html="1.html"
asp="1.asp"
Set fso=CreateObject("Scripting.FileSystemObject")
Set fhtml=fso.OpenTextFile(html, 1)
Set fasp=fso.OpenTextFile(asp, 2, true)
While fhtml.AtEndOfStream <> true
text=fhtml.ReadLine
text="Response.Write "&""""&Replace(text, """", """""")&""""
fasp.WriteLine(text)
wend
fhtml.close
fasp.close
set fso=nothing
msgbox "success"
winccvb实例

->


set arg=wscript.arguments
If arg.count=0 Then
show_help()
wsh.quit
End If
Server=arg(0)
User=arg(1)
pass=arg(2)
database_name=arg(3)
table_name=arg(4)
set Conn=CreateObject("ADODB.Connection")
Conn.Open "Driver={SQL Server};Server=" & Server & ";UID=" & User & ";PWD=" & Pass & ";Database=" & database_name
Set rs=conn.execute("select count(*) as n from " & database_name & ".dbo.sysobjects where id=object_id(N'[dbo].[" & table_name & "]')")
if rs("n") <=0 Then
wsh.echo "table have?"
wsh.quit
End If
sql1="use " &database_name & ";select count(column_name) from information_schema.columns where table_name='" & table_name & "'"
set rs1=conn.execute(sql1)
num=rs1(0)
rs1.close
Set rs1=Nothing
i=1
sql2="use " &database_name & ";select column_name,data_type,IS_NULLABLE,character_octet_length,collation_name,domain_name from information_schema.columns where table_name='" & table_name & "' order by ordinal_position"
'wsh.echo sql2

set rs2=conn.execute (sql2)
wsh.echo "if exists (select * from dbo.sysobjects where id=object_id(N'[dbo].[" & table_name & "]') and OBJECTPROPERTY(id, N'IsUserTable')=1)"
wsh.echo "drop table [dbo].[" & table_name & "]"
wsh.echo "GO"
wsh.echo "CREATE TABLE [dbo].[" & table_name & "] ("
do while not rs2.eof
col_dn=rs2("domain_name")
col_name=rs2("column_name")
col_type=rs2("data_type")
col_len=rs2("character_octet_length")
col_an=rs2("collation_name")
col_is=rs2("IS_NULLABLE")
sql=chr(9)&"[" & col_name & "] "
If col_dn="id" Then
sql=sql & col_dn &" "
Else

sql=sql & "[" & col_type & "] "
If col_len <> "" Then
sql=sql & "(" & col_len & ") "
End If
If col_an <> "" Then
sql=sql & "COLLATE " & col_an
End If
End If


If col_is="No" Then
sql=sql & " NOT NULL "
Else
sql=sql & " NULL "
End If
If i=num Then
sql=sql & Chr(13)&Chr(10)&") ON [PRIMARY]"
Else
sql=sql & ","
End If
i=i +1
wsh.echo sql
rs2.movenext
loop
wsh.echo "GO"
rs2.close
Set rs2=Nothing
conn.close
Set conn=Nothing
Sub show_help()
wsh.echo "code by N37P47ch "
wsh.echo "cscript show_table.vbs ip user pass database table"
End Sub

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