发新话题
打印

[转载]转换字母ASCII值的简单ASP小程序

[转载]转换字母ASCII值的简单ASP小程序

  信息来源:小新技术网

ASP过时了,也需要学习啊,感觉这个转换字母 ASCII值的简单ASP程序,挺有意思,写出来大家也看下啊,错误还请指正。有什么问题请到论坛发帖,或直接找我QQ:12231446交流
演示地址:http://www.maxin.cn/book/ASCII/ASCII.ASP
复制内容到剪贴板
代码:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>输入字符转换为ASCII值的简单小程序--新水年华[url]www.maxin.cn</title>[/url]
<style type="text/css">
<!--
body {
background-color: #CCCCCC;
}
.style1 {font-size: 18px}
.style3 {
font-size: 12px;
color: #333333;
}
.style4 {
font-size: 14px;
color: #333333;
}
.style5 {
font-size: 16px;
font-weight: bold;
color: #990000;
}
-->
</style></head>

<body>
<div align="center">
  <% if request.form("submit") <> "" then %>
</div>
<h1 align="center" class="style1">新水年华告诉你结果</h1><br>
<form method="post">
<input type="button" value="返回上一页"
onclick="history.go(-1);return true;">
</form>
<div align="center"><br>
  <br>
  <br>
  <%
  function safeconvert(strorig)
    dim strtemp
  if isnull(strorig) then
    strtemp = strorig
  else
    strtemp = server.htmlencode(strorig)
  strtemp = replace(strtemp,chr(10),"<br>")
  strtemp = replace(strtemp," ","&nbsp")
  strtemp = replace(strtemp,chr(9),"&nbsp&nbsp&nbsp&nbsp")
  end if
  safeconvert = strtemp
  end function
  
  dim a
  a = request.form("request")
  a = safeconvert(a)
  response.write "输入字母的ASCII的值是:"& asc(a) & vbcrlf
else
%>

  <br>
  <br>
  <span class="style5">输入字符转换为ASCII值的简单小程序<br>
  <br>
  <br>
  <br>
  <br>
</span></div>
<h1 align="center" class="style4">在此输入需要转换为ASCII值的字母:</h1>
<form name="frm_request" method="post" action="ASCII.asp">
  
  <div align="center">
   <input onfocus=this.select() onmouseover=this.focus() name="request" type="text" value="输入需要转换为ASCII值的字母" size="30" maxlength="2">
   <br>
      
  <input name="submit" type="submit" value="提交">
  </div>
</form>
<div align="center">
  <% end if %>
  <br>
  <br>
  

  <br>
  -----------------------------------------------------------------------------------<br>
<br>
  <a href="[url]http://www.maxin.cn[/url]" target="_blank" class="style3">新水年华--小新技术网[url]www.maxin.cn</a></div>[/url]
</body>
</html>
曾几何时,有人对我说:装B遭雷劈。我说:去你妈的。于是,这个人又对我说:如果再说脏话,上帝会惩罚你的。我说:我操上帝。结论:彪悍的人生不需要上帝。

TOP

发新话题