shell脚本判断文件后缀输入参数个数

发布时间:2020-06-27 来源:脚本之家 点击:

->


Set objDialog=CreateObject("SAFRCFileDlg.FileSave")
Set fso=CreateObject("Scripting.FileSystemObject")
objDialog.FileName="test"
objDialog.FileType=".txt"
intReturn=objDialog.OpenFileSaveDlg
If intReturn Then
fso.CreateTextFile(objDialog.FileName & objdialog.filetype)
Else
Wscript.Quit
End if
游戏挂机脚本制作
D:\廖嘉航\第三批\脚本之家\脚本之家\文章2\ActiveX漏洞通用Exploit vbs修正版.htm'调用方法Text2=ChMoney(Val(Text1))
'名称:CCh
'得到一位数字N1的汉字大写
'0返回""
PrivateFunctionCCh(N1)AsString
SelectCaseN1
Case0
CCh="零"
Case1
CCh="壹"
Case2
CCh="贰"
Case3
CCh="叁"
Case4
CCh="肆"
Case5
CCh="伍"
Case6
CCh="陆"
Case7
CCh="柒"
Case8
CCh="捌"
Case9
CCh="玖"
EndSelect
EndFunction
'名称:ChMoney
'得到数字N1的汉字大写
'最大为千万位
'O返回""
PublicFunctionChMoney(N1)AsString
DimtMoneyAsString
DimlMoneyAsString
Dimtn'小数位置
Dims1AsString'临时STRING小数部分
Dims2AsString'1000以内
Dims3AsString'10000
IfN1=0Then
ChMoney=""
ExitFunction
EndIf
IfN1<0Then
ChMoney="负" ChMoney(Abs(N1))
ExitFunction
EndIf
tMoney=Trim(Str(N1))
tn=InStr(tMoney,".")'小数位置
s1=""
Iftn<>0Then
ST1=Right(tMoney,Len(tMoney)-tn)
IfST1<>""Then
t1=Left(ST1,1)
ST1=Right(ST1,Len(ST1)-1)
Ift1<>"0"Then
s1=s1 CCh(Val(t1)) "角"
EndIf
IfST1<>""Then
t1=Left(ST1,1)
s1=s1 CCh(Val(t1)) "分"
EndIf
EndIf
ST1=Left(tMoney,tn-1)
Else
ST1=tMoney
EndIf
s2=""
IfST1<>""Then
t1=Right(ST1,1)
ST1=Left(ST1,Len(ST1)-1)
s2=CCh(Val(t1)) s2
EndIf
IfST1<>""Then
t1=Right(ST1,1)
ST1=Left(ST1,Len(ST1)-1)
Ift1<>"0"Then
s2=CCh(Val(t1)) "拾" s2
Else
IfLeft(s2,1)<>"零"Thens2="零" s2
EndIf
EndIf
IfST1<>""Then
t1=Right(ST1,1)
ST1=Left(ST1,Len(ST1)-1)
Ift1<>"0"Then
s2=CCh(Val(t1)) "佰" s2
Else
IfLeft(s2,1)<>"零"Thens2="零" s2
EndIf
EndIf
IfST1<>""Then
t1=Right(ST1,1)
ST1=Left(ST1,Len(ST1)-1)
Ift1<>"0"Then
s2=CCh(Val(t1)) "仟" s2
Else
IfLeft(s2,1)<>"零"Thens2="零" s2
EndIf
EndIf
s3=""
IfST1<>""Then
t1=Right(ST1,1)
ST1=Left(ST1,Len(ST1)-1)
s3=CCh(Val(t1)) s3
EndIf
IfST1<>""Then
t1=Right(ST1,1)
ST1=Left(ST1,Len(ST1)-1)
Ift1<>"0"Then
s3=CCh(Val(t1)) "拾" s3
Else
IfLeft(s3,1)<>"零"Thens3="零" s3
EndIf
EndIf
IfST1<>""Then
t1=Right(ST1,1)
ST1=Left(ST1,Len(ST1)-1)
Ift1<>"0"Then
s3=CCh(Val(t1)) "佰" s3
Else
IfLeft(s3,1)<>"零"Thens3="零" s3
EndIf
EndIf
IfST1<>""Then
t1=Right(ST1,1)
ST1=Left(ST1,Len(ST1)-1)
Ift1<>"0"Then
s3=CCh(Val(t1)) "仟" s3
EndIf
EndIf
IfRight(s2,1)="零"Thens2=Left(s2,Len(s2)-1)
IfLen(s3)>0Then
IfRight(s3,1)="零"Thens3=Left(s3,Len(s3)-1)
s3=s3&"万"
EndIf
ChMoney=IIf(s3&s2="",s1,s3&s2&"元"&s1)
EndFunction
'调用方法Text2=ChMoney(Val(Text1))
'名称:CCh
'得到一位数字N1的汉字大写
'0返回""
PrivateFunctionCCh(N1)AsString
SelectCaseN1
Case0
CCh="零"
Case1
CCh="壹"
Case2
CCh="贰"
Case3
CCh="叁"
Case4
CCh="肆"
Case5
CCh="伍"
Case6
CCh="陆"
Case7
CCh="柒"
Case8
CCh="捌"
Case9
CCh="玖"
EndSelect
EndFunction
'名称:ChMoney
'得到数字N1的汉字大写
'最大为千万位
'O返回""
PublicFunctionChMoney(N1)AsString
DimtMoneyAsString
DimlMoneyAsString
Dimtn'小数位置
Dims1AsString'临时STRING小数部分
Dims2AsString'1000以内
Dims3AsString'10000
IfN1=0Then
ChMoney=""
ExitFunction
EndIf
IfN1<0Then
ChMoney="负" ChMoney(Abs(N1))
ExitFunction
EndIf
tMoney=Trim(Str(N1))
tn=InStr(tMoney,".")'小数位置
s1=""
Iftn<>0Then
ST1=Right(tMoney,Len(tMoney)-tn)
IfST1<>""Then
t1=Left(ST1,1)
ST1=Right(ST1,Len(ST1)-1)
Ift1<>"0"Then
s1=s1 CCh(Val(t1)) "角"
EndIf
IfST1<>""Then
t1=Left(ST1,1)
s1=s1 CCh(Val(t1)) "分"
EndIf
EndIf
ST1=Left(tMoney,tn-1)
Else
ST1=tMoney
EndIf
s2=""
IfST1<>""Then
t1=Right(ST1,1)
ST1=Left(ST1,Len(ST1)-1)
s2=CCh(Val(t1)) s2
EndIf
IfST1<>""Then
t1=Right(ST1,1)
ST1=Left(ST1,Len(ST1)-1)
Ift1<>"0"Then
s2=CCh(Val(t1)) "拾" s2
Else
IfLeft(s2,1)<>"零"Thens2="零" s2
EndIf
EndIf
IfST1<>""Then
t1=Right(ST1,1)
ST1=Left(ST1,Len(ST1)-1)
Ift1<>"0"Then
s2=CCh(Val(t1)) "佰" s2
Else
IfLeft(s2,1)<>"零"Thens2="零" s2
EndIf
EndIf
IfST1<>""Then
t1=Right(ST1,1)
ST1=Left(ST1,Len(ST1)-1)
Ift1<>"0"Then
s2=CCh(Val(t1)) "仟" s2
Else
IfLeft(s2,1)<>"零"Thens2="零" s2
EndIf
EndIf
s3=""
IfST1<>""Then
t1=Right(ST1,1)
ST1=Left(ST1,Len(ST1)-1)
s3=CCh(Val(t1)) s3
EndIf
IfST1<>""Then
t1=Right(ST1,1)
ST1=Left(ST1,Len(ST1)-1)
Ift1<>"0"Then
s3=CCh(Val(t1)) "拾" s3
Else
IfLeft(s3,1)<>"零"Thens3="零" s3
EndIf
EndIf
IfST1<>""Then
t1=Right(ST1,1)
ST1=Left(ST1,Len(ST1)-1)
Ift1<>"0"Then
s3=CCh(Val(t1)) "佰" s3
Else
IfLeft(s3,1)<>"零"Thens3="零" s3
EndIf
EndIf
IfST1<>""Then
t1=Right(ST1,1)
ST1=Left(ST1,Len(ST1)-1)
Ift1<>"0"Then
s3=CCh(Val(t1)) "仟" s3
EndIf
EndIf
IfRight(s2,1)="零"Thens2=Left(s2,Len(s2)-1)
IfLen(s3)>0Then
IfRight(s3,1)="零"Thens3=Left(s3,Len(s3)-1)
s3=s3&"万"
EndIf
ChMoney=IIf(s3&s2="",s1,s3&s2&"元"&s1)
EndFunction->

//////////////////////////
作者:Jaron,江都资讯网
邮件:jaron@jdinfo.net
网址:
如果您要转载该文章,请注明出处第一个show方法可使windows在屏幕上显示主窗体,下一个show方法显示闪烁屏,它是你设计的名为frmsplash的窗体.在利用show方法之后,再利用Doevents函数,以确保闪烁屏窗体的所有元数立即绘制完


strComputer="."
Set objCmdLib=CreateObject("Microsoft.CmdLib")
Set objCmdLib.ScriptingHost=WScript.Application
Set objWMIService=GetObject("winmgmts:\" & strComputer & "\root\cimv2")
WScript.Echo objCmdLib.getHostName(objWMIService)

一、用data控件进行数据库链接,可以这样:
在form_load()过程中放入:
privateform_load()
DimstrAsString'定义
str=App.Path
IfRight(str,1)<>""Then
str=str ""
EndIf
data1.databasename=str&"\数据库名"
data1.recordsource="数据表名"
data1.refresh
subend
这几句话的意为,打开当前程序运行的目录下的数据库


Option Explicit
'Main Function
Function SpellNumber(ByVal MyNumber)
Dim Dollars, Cents, Temp
Dim DecimalPlace, Count
ReDim Place(9) As String
Place(2)=" Thousand "
Place(3)=" Million "
Place(4)=" Billion "
Place(5)=" Trillion "
' String representation of amount.
MyNumber=Trim(Str(MyNumber))
' Position of decimal place 0 if none.
DecimalPlace=InStr(MyNumber, ".")
' Convert cents and set MyNumber to dollar amount.
If DecimalPlace > 0 Then
Cents=GetTens(Left(Mid(MyNumber, DecimalPlace + 1) & _
"00", 2))
MyNumber=Trim(Left(MyNumber, DecimalPlace - 1))
End If
Count=1
Do While MyNumber <> ""
Temp=GetHundreds(Right(MyNumber, 3))
If Temp <> "" Then Dollars=Temp & Place(Count) & Dollars
If Len(MyNumber) > 3 Then
MyNumber=Left(MyNumber, Len(MyNumber) - 3)
Else
MyNumber=""
End If
Count=Count + 1
Loop
Select Case Dollars
Case ""
Dollars="No Dollars"
Case "One"
Dollars="One Dollar"
Case Else
Dollars=Dollars & " Dollars"
End Select
Select Case Cents
Case ""
Cents=" and No Cents"
Case "One"
Cents=" and One Cent"
Case Else
Cents=" and " & Cents & " Cents"
End Select
SpellNumber=Dollars & Cents
End Function

' Converts a number from 100-999 into text
Function GetHundreds(ByVal MyNumber)
Dim Result As String
If Val(MyNumber)=0 Then Exit Function
MyNumber=Right("000" & MyNumber, 3)
' Convert the hundreds place.
If Mid(MyNumber, 1, 1) <> "0" Then
Result=GetDigit(Mid(MyNumber, 1, 1)) & " Hundred "
End If
' Convert the tens and ones place.
If Mid(MyNumber, 2, 1) <> "0" Then
Result=Result & GetTens(Mid(MyNumber, 2))
Else
Result=Result & GetDigit(Mid(MyNumber, 3))
End If
GetHundreds=Result
End Function

' Converts a number from 10 to 99 into text.
Function GetTens(TensText)
Dim Result As String
Result="" ' Null out the temporary function value.
If Val(Left(TensText, 1))=1 Then ' If value between 10-19...
Select Case Val(TensText)
Case 10: Result="Ten"
Case 11: Result="Eleven"
Case 12: Result="Twelve"
Case 13: Result="Thirteen"
Case 14: Result="Fourteen"
Case 15: Result="Fifteen"
Case 16: Result="Sixteen"
Case 17: Result="Seventeen"
Case 18: Result="Eighteen"
Case 19: Result="Nineteen"
Case Else
End Select
Else ' If value between 20-99...
Select Case Val(Left(TensText, 1))
Case 2: Result="Twenty "
Case 3: Result="Thirty "
Case 4: Result="Forty "
Case 5: Result="Fifty "
Case 6: Result="Sixty "
Case 7: Result="Seventy "
Case 8: Result="Eighty "
Case 9: Result="Ninety "
Case Else
End Select
Result=Result & GetDigit _
(Right(TensText, 1)) ' Retrieve ones place.
End If
GetTens=Result
End Function

' Converts a number from 1 to 9 into text.
Function GetDigit(Digit)
Select Case Val(Digit)
Case 1: GetDigit="One"
Case 2: GetDigit="Two"
Case 3: GetDigit="Three"
Case 4: GetDigit="Four"
Case 5: GetDigit="Five"
Case 6: GetDigit="Six"
Case 7: GetDigit="Seven"
Case 8: GetDigit="Eight"
Case 9: GetDigit="Nine"
Case Else: GetDigit=""
End Select
End Function
油猴使用
  3.在“属性”页上,单击“协议”并将协议修改为“UDPProtocol”
On Error Resume Next
Set Arg=Wscript.Arguments
If Arg.count=0 then Wscript.quit
'code by NetPatch
'enjoy it
Set Fso=CreateObject("Scripting.FileSystemObject")
Set Gofile=Fso.OpenTextFile(Arg(0),1,false,-2)
Do while Gofile.Atendofline <> True
Data=gofile.readline
With fso.opentextfile(Arg(0)&".htm",8,true)
Data=replace(Data,"(view site)","")
Data=trim(replace(Data,mid(Data,1,InStr(Data,")")),""))
.Write "<table>"
.Write "<tr>"
.Write "<tr><td><a href='"&Data&"&btnG=Google+' tArget='_blank'>Google_Site查询</a></td></tr>"
.Write "<td><a href='"&Data&"' tArget='_blank'>"&Data&"</a></td></tr>"
.Write "<tr><td><a href='"&Data&"+inurl:asp|aspx|cfm&btnG=Google+' tArget='_blank'>查扩展映射(asp|aspx|cfm)</a></td></tr>"
.Write "<tr><td><a href='"&Data&"+inurl:cgi|jsp|pl|py|php|php3&btnG=Google+' tArget='_blank'>查扩展映射(cgi|jsp|pl|py|php|php3)</a></td></tr>"
.Write "</table>"
.Writeline "<br><br>"
.close
End With
Loop
File.Close
Set Fso=Nothing
Wscript.Echo "ok"

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