星期三, 八月 11, 2010

QueryCode.vbs text file encoded query tool

Just download this file after you can query the.
The following is a detailed code as follows:

'QueryCode.vbs BY: fastslz
'Support for batch queries, you can extend applications on SendTo
set files = WScript.Arguments
if files.Count = 0 Then
MsgBox "Please check the file to drag into this file!", VbInformation, "File encoded query tool BY: fastslz"
end if
for i = 0 To files.Count-1
file = files (i)
Call CheckCode ("encoded:")
next
Function CheckCode (Usage)
Dim slz
set slz = CreateObject ("Adodb.Stream")
slz.Type = 1
slz.Mode = 3
slz.Open
slz.Position = 0
slz.Loadfromfile file
Bin = slz.read (2)
if AscB (MidB (Bin, 1,1)) = & HEF and AscB (MidB (Bin, 2,1)) = & HBB Then
Codes = "UTF-8"
elseif AscB (MidB (Bin, 1,1)) = & HFF and AscB (MidB (Bin, 2,1)) = & HFE Then
Codes = "Unicode"
else
Codes = "GB2312"
end if
WScript.echo file, Usage, Codes
slz.Close
set slz = Nothing
End Function

没有评论:

发表评论