b2科目四模拟试题多少题驾考考爆了怎么补救
b2科目四模拟试题多少题 驾考考爆了怎么补救

.dat文件是个授权文件,用编辑器打开后乱码,想知道是哪个加密方式

电脑杂谈  发布时间:2020-01-03 05:01:51  来源:网络整理

dat格式用什么打开方式_dat格式用什么打开_dat格式文件用什么打开

Sub ReadFiles

Dim fso, f1, ts, s

Const ForReading = 1

Set fso = CreateObject("Scripting.FileSystemObject")

Set f1 = fso.CreateTextFile("F:\testfile.txt", True)

'写一行。

msgbox "Writing file <br>"

f1.WriteLine Str2Num("Hello World")

f1.WriteBlankLines(1)

f1.Close

' 读取文件的内容。

msgbox "Reading file"

Set ts = fso.OpenTextFile("F:\testfile.txt", ForReading)

s = ts.ReadLine

msgbox "File contents = '" & Num2Str(s) & "'"

ts.Close

End Sub

call readfiles

'以上为文件读写

'以下为Str2Num和Num2Str函数

On Error Resume Next

dat格式用什么打开_dat格式用什么打开方式_dat格式文件用什么打开

Function Encrypt(theNumber)

On Error Resume Next

Dim n, szEnc,tdat格式用什么打开方式, HiN, LoN, i

n = CDbl((theNumber + 1570) ^ 2 - 7 * (theNumber + 1570) - 450)

If n < 0 Then szEnc = "R" Else szEnc = "J"

n = CStr(abs(n))

For i = 1 To Len(n) step 2

t = Mid(n, i, 2)

If Len(t) = 1 Then

szEnc = szEnc & t

Exit For

End If

HiN = (CInt(t) And 240) / 16

LoN = CInt(t) And 15

szEnc = szEnc & Chr(Asc("M") + HiN) & Chr(Asc("C") + LoN)

Next

Encrypt = szEnc

End Function

Function Decrypt(theNumber)

On Error Resume Next

Dim e, n, sign, t, HiN, LoN, NewN, i

dat格式用什么打开方式_dat格式用什么打开_dat格式文件用什么打开

e = theNumber

If Left(e, 1) = "R" Then sign = -1 Else sign = 1

e = Mid(e, 2)

NewN = ""

For i = 1 To Len(e) step 2

t = Mid(e, i, 2)

If Asc(t) >= Asc("0") And Asc(t) <= Asc("9") Then

NewN = NewN & t

Exit For

End If

HiN = Mid(t,1dat格式用什么打开方式, 1)

LoN = Mid(t, 2, 1)

HiN = (Asc(HiN) - Asc("M")) * 16

LoN = Asc(LoN) - Asc("C")

t = CStr(HiN Or LoN)

If Len(t) = 1 Then t = "0" & t

NewN = NewN & t

Next

e = CDbl(NewN) * sign

Decrypt = CLng((7 + sqr(49 - 4 * (-450 - e))) / 2 - 1570)

End Function

dat格式用什么打开方式_dat格式用什么打开_dat格式文件用什么打开

Function Str2Num(vIn)

dim strReturn,ThisCharCode,NextCharCode

strReturn = ""

For i = 1 To Len(vIn)

ThisCharCode = hex(AscW(Mid(vIn,i,1)))

if (len(ThisCharCode) mod 2) <> 0 then

ThisCharCode = "0" & ThisCharCode

end if

strReturn = strReturn & "%" & ThisCharCode

Next

Str2Num = strReturn

End Function

Function Num2Str(vIn)

dim strReturn,arr,i

strReturn = ""

arr = split(vIn,"%")

For each i in arr

if i <> "" then

strReturn = strReturn & ChrW(eval("&H" & i))

end if

Next

dat格式文件用什么打开_dat格式用什么打开_dat格式用什么打开方式

Num2Str = strReturn

End Function

Function Str2NumEnc(vIn)

dim strReturn,ThisCharCode,NextCharCode

strReturn = ""

For i = 1 To Len(vIn)

strReturn = strReturn & "%" & Encrypt(AscW(Mid(vIn,i,1)))

Next

Str2NumEnc = strReturn

End Function

Function Num2StrDec(vIn)

dim strReturn,arr,i

strReturn = ""

arr = split(vIn,"%")

For each i in arr

if i <> "" then

strReturn = strReturn & ChrW(eval(Decrypt(i)))

end if

Next

Num2StrDec = strReturn

End Function

'其实这也算不上哪个加密只能说一种编码而已


本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/shumachanpin/article-135627-1.html

    相关阅读
      发表评论  请自觉遵守互联网相关的政策法规,严禁发布、暴力、反动的言论

      热点图片
      拼命载入中...