您现在的位置: 军旅同心 >> 读书赏析 >> 学习园地 >> 电脑网络 >> 技术文章 >> 文章正文
编写一个asp代码执行器
作者:采集员 文章来源:来源于网络 点击数: 更新时间:2005-9-10 13:12:23
sp;   Response.write ("</BODY></HTML>")
END IF '-------TOT

SUB loginMain()
    %>

        <FORM METHOD=POST ACTION="?action=chkpass">&nbsp;UserName:<INPUT TYPE="text" NAME="UserName"><br>
        &nbsp;PassWord:<INPUT TYPE="password" NAME="Runpassword"><br>
        CheckCode:<INPUT TYPE="GetCode" NAME="GetCode"><img src="runasp.asp?action=GetCode&Time=<%=timer()%>"><br>
        <br><img width=125 height=0><INPUT TYPE="submit" value=" Login "></FORM>
    <%   
End SUB

function checkPass()
    dim UserName,Runpassword,GetCode
    dim errinfo
    checkPass=""
    UserName=trim(request.form("UserName"))
    Runpassword=trim(request.form("Runpassword"))
    GetCode=request.form("GetCode")
    if UserName="" or Runpassword="" then
        errinfo=errinfo&"<li>用户名和密码输入不能为空"
    end if
    if Not isnumeric(GetCode) then
        errinfo=errinfo&"<li>请输入数字校验码"
    end if
    if errinfo<>"" then
        call loginmain()       
        EndProc errinfo
    end if
    if action="chkpass" and Session("GetCode")=int(GetCode) and UserName=SUserName and Runpassword=Spassword then
        Session("GetCode")=0
        checkPass="1"
    else
        call loginmain()
        EndProc "登陆失败!请重新确认正确输入"
    end if
End function

SUB    ExeCuteIt(ExString)
    on error resume next
    Execute(ExString)
    if err.number<>0 then
        Response.write "<div style=""background-color: #ffeedd;padding: 6px;"">"
        Response.write "<hr size=1>"
        Response.write "出错信息:<li><font color=#ff0000>"&err.description&"</font>"
        Response.write "<hr size=1>"
        Response.write "出错代码:<li><font color=#0000ff>"&Htmlencode(ExString)&"</font>"
        Response.write "<hr size=1></div>"
    end if
    on error goto 0
end SUB

function HTMLEncode(reString)
    dim Str:Str=reString
    if not isnull(Str) then
        Str = replace(Str, ">", "&gt;")
        Str = replace(Str, "<", "&lt;")
        Str = Replace(Str, CHR(32), "&nbsp;")
        Str = Replace(Str, CHR(9), "&nbsp;&nbsp;&nbsp;&nbsp;")
        Str = Replace(Str, CHR(34), "&quot;")    ' "
        Str = Replace(Str, CHR(39), "'")    ' '
        Str = Replace(Str, CHR(13), "")
        Str = Replace(Str, CHR(10) & CHR(10), "</P><P> ")
        Str = Replace(Str, CHR(10), "<BR> ")
        HTMLEncode = Str
    else
        HTMLEncode=""
    end if
end function

'断点调试 num=0 中断
Sub Response_write(str,num)
    dim istr:istr=str
    dim inum:inum=num
    response.write str&"<br>"
    if inum=0 then response.end
end sub

SUB EndProc(info)
    Response.write "<hr size=1 color=#00aa00>"
    Response.write info
    Response.write "<hr size=1 color=#00aa00><a href=""javascript:window.history.back();"">返回运行页面</a><br><br>"
    Response.write "<a href=""?action=exit"">退出登陆</a>"
    response.end
End SUB   
%>
<script language="JScript" runat="Server">
function GetNO(num){
        var NumArray=[
                ]["0","0","0","3c","66","66","66","66","66","66","66","66","3c","0","0","0"],
                ["0","0","0","30","38","30","30","30","30","30","30","30","30","0","0","0"],
                ["0","0","0","3c","66","60","60","30","18","c","6","6","7e","0","0","0"],
                ["0","0","0","3c","66","60","60","38","60","60","60","66","3c","0","0","0"],
                ["0","0","0","30","30","38","38","34","34","32","7e","30","78","0","0","0"],
                ["0","0","0","7e","6","6","6","3e","60","60","60","66","3c","0","0","0"],
                ["0","0","0","38","c","6","6","3e","66","66","66","66","3c","0","0","0"],
                ["0","0","0","7e","66","60","60","30","30","18","18","c","c","0","0","0"],
                ["0","0","0","3c","66","66","66","3c","66","66","66","66","3c","0","0","0"],
                ["0","0","0","3c","66","66","66","66","7c","60","60","30","1c","0","0","0"]
                ];
        var str=[];
        num=String(num).split("");
        for(var i=0;i<NumArray[0].length;i++)
                for(var j=0;j<num.length;j++)
                        str[str.length]=("0x"+NumArray[num[j]][i]);
        var str1="#define counter_width "+j*8;
        var str2="#define counter_height 16";
        return str1+String.fromCharCode(13,10)+str2+String.fromCharCode(13,10)+"static unsigned char counter_bits[]={"+str+"}";
        }
function GetRnd(Num){
        return Math.floor(Math.random()*Math.pow(10,Num));
        }
function NumCodeJS()
    {
    Response.buffer=true
    var zNum;
    var zNum=GetRnd(4);
    if (zNum<1000) zNum+=999;
    Session("GetCode") = zNum;
    Response.ContentType="image/x-xbitmap";
    Session("GetCode") = zNum;
    Response.Write(GetNO(zNum));
    }
</script>

 

上一页  [1] [2] 


 
免责声明:作品版权归所属媒体与作者所有!!本站刊载此文不代表同意其说法或描述,仅为提供更多信息。如果您认为我们侵犯了您的版权,请告知!本站立即删除。有异议请联系我们。
文章录入:烟灰缸    责任编辑:烟灰缸 
  • 上一篇文章:
  • 下一篇文章:
  • 网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
    | 设为首页 | 加入收藏 | 联系站长 | 友情链接 | 版权申明 | 网站公告 | 管理登录 |