ASP.NET 页面中 滚动当前系统时间
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default3.aspx.cs" Inherits="Admin_Default3" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script language="javascript" type ="text/javascript">
function tick()
{
var hours, minutes, seconds, xfile;
var intHours, intMinutes, intSeconds;
var today, theday;
today = new Date();
function initArray(){
this.length=initArray.arguments.length
for(var i=0;i<this.length;i++)
this[i+1]=initArray.arguments[i] }
var d=new initArray(
"星期日",
"星期一",
"星期二",
"星期三",
"星期四",
"星期五",
"星期六");
theday = today.getYear()+"年" + [today.getMonth()+1]+"月" +today.getDate() + d[today.getDay()+1];
intHours = today.getHours();
intMinutes = today.getMinutes();
intSeconds = today.getSeconds();
if (intHours == 0) {
hours = "12:";
xfile = "午夜";
} else if (intHours <12) {
hours = intHours+":";
xfile = "上午";
} else if (intHours == 12) {
hours = "12:";
xfile = "正午";
} else {
intHours = intHours - 12
hours = intHours + ":";
xfile = "下午";
}
if (intMinutes <10) {
minutes = "0"+intMinutes+":";
} else {
minutes = intMinutes+":";
}
if (intSeconds < 10) {
seconds = "0"+intSeconds+" ";
} else {
seconds = intSeconds+" ";
}
timeString = theday+xfile+hours+minutes+seconds;
var textNode=document.createTextNode(timeString); //create拼写
currentElement=document.getElementById("time");
currentElement.replaceChild(textNode,currentElement.firstChild);
setTimeout("tick()",1000);
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>无标题页</title>
</head>
<body onload="tick()">
<form id="form1" runat="server">
<MARQUEE id="time" scrollA
相关文档:
在Web编程过程中,存在着很多安全隐患。比如在以前的ASP版本中,Cookie为访问者和编程者都提供了方便,并没有提供加密的功能。打开IE浏览器,选择“工具”菜单里的“Internet选项”,然后在弹出的对话框里单击“设置”按钮,选择“查看文件”按钮,在弹出的窗口中,就会显示硬盘里 ......
作者:敖士伟
在Fedora 12上的安装过程
一、mono安装
yum install gcc gcc-c++ bison pkgconfig glib2-devel gettext make libgdiplus Cairo
wget http://ftp.novell.com/pub/mono/sources/mono/mono-2.6.1.tar.bz2
tar jxvf mono-2.6.1.tar.bz2
cd mono-2.6.1
./configure --prefix=/usr
make
make install
安装 ......
新建一个专门用来创建验证码图片的页面ValidateCode.aspx
它的后台cs文件代码如下:
PageLoad
复制代码 代码如下:
private void Page_Load(object sender, System.EventArgs e)
{
string checkCode = CreateRandomCode(4);
Session["CheckCode"] = checkCode;
CreateImage(checkCode);
}
其中CreateRand ......
任何一种使用数据库web程序(当然,也包括桌面程序)都有被SQL注入的风险。防止被SQL注入,最基本的方法是在代码级别就要阻止这种可能,这个网上讲的很多,我就不多说了。不过如果你拿到的是一个已经完工的产品,这个时候该如何解决呢?我介绍几种对于ASP和ASP.NET有效的防止SQL注入的方案,而且是免费的。
UrlScan 3.1
......