博文
智能计算器(2006-04-17 10:41:00)
摘要:<html>
<head>
<title>智能计算器</title>
<script language="javascript">
function compute_onclick(){
var o=document.form1.input.value;
var result=eval(o);
document.form1.result.value=result;
}
</script>
</head>
<body><center>
<form name="form1">
<p>请输入表达式 <input type="text" name="input"></p>
<p><input type="button" value="计算" name="compute" onclick="compute_onclick()"></p>
<p>结果<input type="text" value="" name="result"></p>
</form>
</body>
</html>......
两个下拉列表(2006-04-17 10:40:00)
摘要:<script language="javascript">
function show()
{
for (var i=0;i<document.getElementById("s1").length;i++)
{for (var j=0;j<document.getElementById("s2").length-1;j++)
{
document.getElementById("s2").options.remove(j);
}
if (document.getElementById("s1").options[i].selected)
{show1(document.getElementById("s1").options[i].value);
break;
}
}
}
function show1(v)
{for (var i=1;i<=v;i++)
{
document.getElementById("s2").options[i]=new Option(i,i);
}
document.getElementById("s2").options.remove(0);
}
</script>
<select name="s1" onchange="show()" id="s1">
<option value="">请选择</option>
<option value=10>10</option>
<option value=2......
如何得到字符串的每一位?(2006-04-15 16:43:00)
摘要:如何得到字符串的每一位?
如:str="123456"
a=str的第一位就是1
b=str的第二位就是2
c=str的第三位就是3
……
解决的方法
dim ak()
for i=1 to len(XXX)
ak(i)=mid(XXX,i,1)
next
......
VC对话框打印功能(2006-04-15 13:17:00)
摘要:void CGetipDlg::OnButton3()
{
CPrintDialog print(false);
if(print.DoModal()==IDOK)
{
CDC printcd;
printcd.Attach(print.GetPrinterDC());
DOCINFO pdoc;
pdoc.cbSize=sizeof(pdoc);
pdoc.lpszDocName="pdoc";
pdoc.lpszDatatype=NULL;
pdoc.fwType=NULL;
pdoc.lpszOutput=NULL;
if(printcd.StartDoc(&pdoc)>=0)
{
LOGFONT logfont;
memset(&logfont,0,sizeof(LOGFONT));
logfont.lfHeight=75;
CFont fon......
常见的ASP代码(2006-04-15 09:38:00)
摘要:1.获得系统时间:
<%=now()%>
2.取得来访用的IP:
<%=request.serverVariables("remote_host")%>
3.获得系统,浏览器版本:
<script>
window.document.write("版本:"+navigator.appName+navigator.appVersion+" browser.")
</script>
4.去除IE混动条:
<body scroll="no">
<body style="overflow-y:hidden">
5.进入网站,跳出广告:
<script language="javascript">
<!--
<!-- 注意更改文件所在路径-->
window.open(''http://www.gbunix.com",'''',''height=200,width=300,top=0,left=30'');
// -->
</script>
6.随机数:
<%randomize%>
<%=(int(rnd()*n)+1)%>
N为可改变数
7.向上混动代码:
<marquee direction="up" scrolldelay="200" style="font-size: 9pt; color: #FF0000;
line-height: 150%; font-style:italic; font-weight:bold" scrollamount="2" width="206"
height="207" bgcolor="#FFFF00">Unix中文站</marquee>
8.自动关闭网页:
<script LANGUAGE="javascript">
<!--
setTimeout(''window.close();'', 10000); //60秒后关闭
// -->
......
文件区域html格式(2006-04-13 09:28:00)
摘要:这个网页的名字叫:text.asp
<%
' 内容提交前用这个函数
Function HTMLEncode(fString)'HTML加码函数
If Not IsNull(fString) Then
fString = Replace(fString, CHR(38), "&")
fString = Replace(fString, ">", ">")
fString = Replace(fString, "<", "<")
fString = Replace(fString, CHR(39), "'")
fString = Replace(fString, CHR(32), " ")
fString = Replace(fString, CHR(34), """)
fString = Replace(fString, CHR(13), "")