中文人妻久热无码_天天看高清国产在线_富婆按摩高潮对白30分钟_国产av精选aaaaaaa

海南世紀(jì)云圖網(wǎng)絡(luò)科技有限公司
咨詢(xún)熱線:400-822-8458 客戶(hù)服務(wù):0898-32183600

ASP隨機(jī)生成漢字的方法

發(fā)表于:2011-02-28 00:00:00來(lái)源:人氣:3242

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>ASP隨機(jī)生成漢字的方法</title>
</head>

<body>
<%Dim i
    Dim j
    Dim HS
    Dim HE
    Dim LS
    Dim LE
    dim Result
    Result=""
    HS = 177
    HE = 247
    LS = 161
    LE = 254
    dim Max_Num
    Max_num=65536
    Randomize  
    For i = 1 To 4
temp1=dec2bin(Int((HE - HS) * Rnd()) + HS)
temp2=dec2bin(Int((LE - LS) * Rnd()) + LS)
        Result = Result & chr(BinaryToDecimal(temp1 & temp2) - Max_num)

    Next
    response.write Result & " "
%>
<%
    ''下面是函數(shù)
''-------------------------------------------
Public Function dec2bin(mynum)''十進(jìn)制到二進(jìn)制
Dim loopcounter
If mynum >= 2 ^ 31 Then
dec2bin = "Too big"
Exit Function
End If
Do
If (mynum And 2 ^ loopcounter) = 2 ^ loopcounter Then
dec2bin = "1" & dec2bin
Else
dec2bin = "0" & dec2bin
End If
loopcounter = loopcounter + 1
Loop Until 2 ^ loopcounter > mynum
End Function
''-------------------------------------------
Public Function BinaryToDecimal(BinaryValue) ''二進(jìn)制到十進(jìn)制的轉(zhuǎn)換
'' Returns the decimal equivalent of a binary number
Dim idx
Dim tmp
Dim result
Dim digits
digits = Len(BinaryValue)
For idx = digits To 1 Step -1   
    tmp = Mid(BinaryValue, idx, 1)
    If tmp = "1" Then result = result + 2 ^ (digits - idx)
Next
BinaryToDecimal = result

End Function
%>
</body>
</html>

文章整理: 世紀(jì)云圖  http://m.jhchurchillbuilders.com/

以上信息與文章正文是不可分割的一部分,如果您要轉(zhuǎn)載本文章,請(qǐng)保留以上信息,謝謝!

版權(quán)申明:本站文章部份來(lái)自網(wǎng)絡(luò),如有侵權(quán),請(qǐng)聯(lián)系我們,我們收到后立即刪除,謝謝!

特別注意:本站部份轉(zhuǎn)載文章言論不代表本站觀點(diǎn),本站所提供的攝影照片,插畫(huà),設(shè)計(jì)作品,如需使用,請(qǐng)與原作者聯(lián)系,版權(quán)歸原作者所有。

微信
網(wǎng)站建設(shè)
軟件業(yè)務(wù)
網(wǎng)絡(luò)營(yíng)銷(xiāo)
400電話