2009年11月09日 星期一 10:48
2009年11月08日 星期日 13:24
<%
dim conn as new oledbconnection("provider=microsoft.jet.oledb.4.0;extended properties=excel 8.0;data source="+server.mappath("excel.xls"))
dim cmd as new oledbcommand("select * from [table$]",conn)
conn.open()
dim dr as oledbdatareader=cmd.executereader()
dim i as integer
while(dr.read())
for i=0 to dr.fieldcount-1
response.write("i="+i.tostring()+" "+dr.item(i).tostring()+" ")
next
response.write("<br>")
end while
dr.close()
conn.close()
%>
excel第一行就是字段 |
2009年11月08日 星期日 10:21
<%
dim conn as new oledbconnection("provider=microsoft.jet.oledb.4.0;data source="+server.mappath("db.mdb"))
conn.open()
dim dt as datatable=conn.getoledbschematable(oledbschemaguid.tables,new object() {nothing, nothing, nothing, "table"})
dim i,j as integer
for i=0 to dt.rows.count-1
for j=0 to dt.columns.count-1
response.write("i="+i.tostring()+"j="+j.tostring()+dt.rows(i)(j)+"<br>"+chr(10)+chr(13))
next
next
conn.close()
%>
<%
dim conn as new oledbconnection("provider=microsoft.jet.oledb.4.0;data source="+server.mappath("db.mdb"))
dim cmd as new oledbcommand("select [name] from msysobjects where [type]=1",conn)
conn.open()
dim dr as oledbdatareader=cmd.executereader()
while(dr.read())
response.write(dr.item(0).tostring()+"<br>")
end while
dr.close()
conn.close()
%>
上面这种方法需要设置数据库中msysobjects表的权限
<%
dim conn as new sqlconnection("server=localhost;database=db;uid=sa;pwd=sa")
dim cmd as new sqlcommand("select name from sysobjects where type='u'",conn)
conn.open()
dim dr as sqldatareader=cmd.executereader()
while(dr.read())
response.write(dr.item(0).tostring()+"<br>")
end while
dr.close()
conn.close()
%> |
2009年10月17日 星期六 15:22
mtv制作圣手10.0
优点:
速度还可以
可以定义背景颜色
支持lrc ksc两种歌词
支持片头片尾
支持歌名、演唱者、制作者、说明等信息,并可定义字体、字体大小、颜色、时间
支持歌词位置定义,字体、颜色、大小
缺点
只能导入图片不能导入视频
mtv电子相册
缺点
不能定义字幕位置
dv视频字幕合成伴侣
缺点
速度慢
巨星mtv
什么方面都比较好
sayatoo与会声会影搭配
还好,只是比较麻烦 |
2009年09月05日 星期六 12:30
private shared server as object=httpcontext.current.server |
2009年09月02日 星期三 20:11
< %@page contentType="text/html;charset=gb2312" language="java" import="java.sql.*"%>
<%
String url="jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ="+application.getRealPath("db.mdb");
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection conn= DriverManager.getConnection(url);
Statement stmt=conn.createStatement();
ResultSet rs = stmt.executeQuery("select * from tablename");
while(rs.next())
{
out.print(rs.getString("id"));
}
rs.close();
stmt.close();
conn.close();
%> |
2009年08月22日 星期六 22:26
index.aspx文件中的代码如下:
< %@import namespace="xxfaxy"%>
<script language="vb" runat="server">
dim zc as new classname
</script>
<%=zc.sum(10,90)%>
index.vb文件中的代码如下:
namespace xxfaxy
public class classname:inherits system.web.ui.page
function sum(m as integer,n as integer) as integer
sum=m+n
end function
end class
end namespace
编译命令如下:(把下面的代码放进a.bat文件里然后把index.vb和a.bat拷到编译器目录下)
vbc /t:library /out:index.dll index.vb /r:system.dll /r:system.data.dll
生成的index.dll放在bin目录里面的 |
2009年08月16日 星期日 15:25
<?php
class access{
//////////////////////////////////////////////////
function delete($db,$table,$id){
$conn=new com("adodb.connection");
$conn->open("provider=microsoft.jet.oledb.4.0;data source=".realpath($db));
$rs=new com("adodb.recordset");
$rs->open("delete from $table where id=$id",$conn,3,2);
}
//////////////////////////////////////////////////
function select($db,$table,$id){
$conn=new com("adodb.connection");
$conn->open("provider=microsoft.jet.oledb.4.0;data source=".realpath($db));
$rs=new com("adodb.recordset");
$rs->open("select * from $table where id=$id",$conn,3,2);
return $rs;
}
//////////////////////////////////////////////////
}
?> |
2009年08月12日 星期三 22:49
2 数字
3 数字
4 单精度
5 双精度
6 货币
7 日期/时间
11 是/否
128 二进制
202 文本
203 备注
204 二进制
205 ole对象
不指定 文本 |
2009年08月12日 星期三 22:33
<%
class mf
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''001 输出变量x的值
public function shuchu(x)
response.write(x)
end function
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''002 检查文件是否存在
public function checkfile(filename)
set fso=createobject("scripting.filesystemobject")
if fso.fileexists(filename) then
checkfile=true
else
checkfile=false
end if
set fso=nothing
end function
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''003 删除文件
public function deletefile(filename)
set fso=createobject("scripting.filesystemobject")
if fso.fileexists(filename) then
fso.deletefile(filename)
deletefile=true
else
deletefile=false
end if
set fso=nothing
end function
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''004 检查目录是否存在
public function checkdir(dirname)
set fso=createobject("scripting.filesystemobject")
if(fso.folderexists(dirname)) then
checkdir=true
else
checkdir=false
end if
set fso=nothing
end function
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''005 创建目录
public function createdir(dirname)
set fso=createobject("scripting.filesystemobject")
if(fso.folderexists(dirname)) then
createdir=false
else
fso.createfolder(dirname)
createdir=true
end if
set fso=nothing
end function
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''006 删除目录
public function deletedir(dirname)
set fso=createobject("scripting.filesystemobject")
if(fso.folderexists(dirname)) then
fso.deletefolder(dirname)
deletedir=true
else
deletedir=false
end if
set fso=nothing
end function
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''007 判断奇数
public function isjs(number)
flag=(number mod 2)
if flag=1 then
isjs=true
else
isjs=false
end if
end function
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''008 1到n的一次方和
public function sum1(n)
sum1=0
for i=0 to n
sum1=sum1+i
next
end function
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''009 1到n的二次方和
public function sum2(n)
sum2=(2 * n * n * n + 3 * n * n + n) \ 6
end function
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''010 1到n的三次方和
public function sum3(n)
sum3 = (n * n * (n + 1) * (n + 1)) \ 4
end function
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''011 1到n的四次方和
public function sum4(n)
sum4 = (6 * n * n * n * n * n + 15 * n * n * n * n + 10 * n * n * n - n) \ 30
end function
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''012 1到n的五次方和
public function sum5(n)
sum5 = (2 * n * n * n * n * n * n + 6 * n * n * n * n * n + 5 * n * n * n * n - n * n) \ 12
end function
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''013 最大值
public function max(a, b)
if (a > b) then
max = a
else
max = b
end if
end function
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''014 最小值
public function min(a, b)
if (a > b) then
min = b
else
min = a
end if
end function
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''015 a到b的随机整数
public function rand(a, b)
randomize
rand = int((b - a + 1) * rnd + a)
end function
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''016 三角形面积
public function tarea(a, b, c)
dim p
p = (a + b + c) / 2
tarea = sqr(p * (p - a) * (p - b) * (p - c))
if (tarea = 0) then
tarea = "你输入的三条边长不能构成一个三角形"
end if
end function
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''017 阶乘
public function factorial(n)
dim i
factorial = 1
for i = 1 to n
factorial = factorial * i
next
end function
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''018 转到到KB MB GB
public function byteto(n)
if (n < 0) then
byteto = "调用此函数的参数错误"
elseif (n < 1024) then
byteto = cstr(n) + "B"
elseif (n < 1048576) then
byteto = cstr(n \ 1024) + "KB"
elseif (n < 1073741824) then
byteto = cstr(n \ 1048576) + "MB"
elseif (n < 1099511627776) then
byteto = cstr(n \ 1073741824) + "GB"
else
byteto = "文件过大"
end if
end function
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''019 长时间
public function datetime()
dim dt
dt = now()
dim xyear, xmonth, xday, xhour, xminute, xsecond, xweek
dim yyear, ymonth, yday, yhour, yminute, ysecond, yweek, tg, dz, sx
xyear = year(dt)
xmonth = month(dt)
xday = day(dt)
xhour = hour(dt)
xminute = minute(dt)
xsecond = second(dt)
xweek = weekday(dt)
yyear = cstr(xyear)
if (xmonth < 10) then
ymonth = "0" + cstr(xmonth)
else
ymonth = cstr(xmonth)
end if
if (xday < 10) then
yday = "0" + cstr(xday)
else
yday = cstr(xday)
end if
if (xhour < 10) then
yhour = "0" + cstr(xhour)
else
yhour = cstr(xhour)
end if
if (xminute < 10) then
yminute = "0" + cstr(xminute)
else
yminute = cstr(xminute)
end if
if (xsecond < 10) then
ysecond = "0" + cstr(xsecond)
else
ysecond = cstr(xsecond)
end if
'******************************
select case xweek
case 1
yweek = "星期日"
case 2
yweek = "星期一"
case 3
yweek = "星期二"
case 4
yweek = "星期三"
case 5
yweek = "星期四"
case 6
yweek = "星期五"
case else
yweek = "星期六"
end select
'******************************
select case (xyear mod 1000)
case 0
tg = "庚"
case 1
tg = "辛"
case 2
tg = "壬"
case 3
tg = "癸"
case 4
tg = "甲"
case 5
tg = "乙"
case 6
tg = "丙"
case 7
tg = "丁"
case 8
tg = "戊"
case 9
tg = "己"
end select
'******************************
select case (xyear mod 12)
case 0
dz = "申"
sx = "猴"
case 1
dz = "酉"
sx = "鸡"
case 2
dz = "戌"
sx = "狗"
case 3
dz = "亥"
sx = "猪"
case 4
dz = "子"
sx = "鼠"
case 5
dz = "丑"
sx = "牛"
case 6
dz = "寅"
sx = "虎"
case 7
dz = "卯"
sx = "兔"
case 8
dz = "辰"
sx = "龙"
case 9
dz = "巳"
sx = "蛇"
case 10
dz = "午"
sx = "马"
case 11
dz = "未"
sx = "羊"
end select
'******************************
datetime = yyear + "年" + ymonth + "月" + yday + "日" + yhour + ":" + yminute + ":" + ysecond + yweek + "[" + tg + dz + sx + "]"
end function
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''020 绝对路径
function realpath(path)
realpath=server.mappath(path)
end function
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''021 数据库连接
function connstring(db)
connstring="provider=microsoft.jet.oledb.4.0;data source="&server.mappath(db)
end function
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''022 分辨率宽度
function width()
width="<script language=javascript>document.write(screen.width);</script>"
end function
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''023 分辨率高度
function height()
height="<script language=javascript>document.write(screen.height);</script>"
end function
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''024 删除记录
function deleters(db,table,key,id)
deleters=false
set conn=server.createobject("adodb.connection")
'conn.open("provider=microsoft.jet.oledb.4.0;data source="&server.mappath(db))
conn.open(connstring(db))
set rs=server.createobject("adodb.recordset")
rs.open "delete from "&table&" where "&key&"="&id,conn,3,2
set conn=nothing
deleters=true
end function
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''025 n的m次方
function pow(n,m)
pow=n^m
end function
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''026 最大公约数
function gcd(n,m)
i=min(n,m)
do while(i>=1)
if((m mod i)=0 and(n mod i)=0) then
gcd=i
exit do
else
gcd=1
end if
i=i-1
loop
end function
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''027 最小公倍数
function lcm(n,m)
i=max(n,m)
do while(i<=m*n)
if((i mod m)=0 and (i mod n)=0) then
lcm=i
exit do
else
lcm=i
end if
i=i+1
loop
end function
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''028 斐波那契数列第n项
function fs(n)
dim arr(50)
arr(0)="不存在"
arr(1)=1
arr(2)=1
for i=3 to n
arr(i)=arr(i-1)+arr(i-2)
next
fs=arr(n)
end function
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''029 判断素数
function prime(n)
temp=int(sqr(n))
for i=2 to temp
if((n mod i)=0) then
exit for
end if
next
if(i>temp) then
prime=true
else
prime=false
end if
if(n=0 or n=1) then
prime=false
end if
end function
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''030 创建access数据库
function createdb(db)
set fso=server.createobject("scripting.filesystemobject")
if fso.fileexists(realpath(db)) then
createdb="数据库"+db+"已经存在"
else
set adox=createobject("adox.catalog")
adox.create(connstring(db))
createdb="数据库"+db+"已经创建"
set adox=nothing
end if
set fso=nothing
end function
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''031 创建access数据库并定义表(adox)
function createtable(db,table,xarr)
path="provider=microsoft.jet.oledb.4.0;data source="&server.mappath(db)
set fso=server.createobject("scripting.filesystemobject")
if fso.fileexists(realpath(db)) then
createtable=false
else
set adox=createobject("adox.catalog")
adox.create(path)
set adoxtable=createobject("adox.table")
adoxtable.name=table
'******************************
wd=ubound(xarr)
for i=0 to wd
adoxtable.columns.append arr(i,0),arr(i,1)
next
'******************************
adox.tables.append adoxtable
createtable=true
end if
end function
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''032 创建access数据库并定义表(sql)
function createtablesql(db,table,xarr)
set fso=server.createobject("scripting.filesystemobject")
if fso.fileexists(server.mappath(db)) then
createtablesql=false
else
set adoxcatalog=server.createobject("adox.catalog")
adoxcatalog.create(connstring(db))
set conn=server.createobject("adodb.connection")
conn.open connstring(db)
set rs=server.createobject("adodb.recordset")
tablesql="create table "&table&"("
'******************************
wd=ubound(xarr)
for i=0 to wd-1
tablesql=tablesql+xarr(i)+","
next
tablesql=tablesql+xarr(wd)
'******************************
tablesql=tablesql+")"
on error resume next
rs.open tablesql,conn,1,3
rs.close
set rs=nothing
conn.close
set conn=nothing
createtablesql=true
end if
set fso=nothing
end function
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''033
end class
%> |
2009年08月09日 星期日 20:47
首先加上如下代码:
<%@import namespace=system.data%>
<%@import namespace=system.data.oledb%>
然后是如下代码:
<%
dim conn as new oledbconnection("provider=microsoft.jet.oledb.4.0;data source="+server.mappath("db.mdb"))
dim comm as new oledbcommand("select * from db",conn)
conn.open()
dg.datasource=comm.executereader()
dg.databind()
conn.close()
%>
<asp:datagrid id="dg" runat="server"></asp:datagrid>
即:
<%@import namespace=system.data%>
<%@import namespace=system.data.oledb%>
<%
dim conn as new oledbconnection("provider=microsoft.jet.oledb.4.0;data source="+server.mappath("db.mdb"))
dim comm as new oledbcommand("select * from db",conn)
conn.open()
dg.datasource=comm.executereader()
dg.databind()
conn.close()
%>
<asp:datagrid id="dg" runat="server"></asp:datagrid>
或者:
<%@import namespace=system.data%>
<%@import namespace=system.data.oledb%>
<%
dim conn as new oledbconnection("provider=microsoft.jet.oledb.4.0;data source="+server.mappath("db.mdb"))
dim comm as new oledbcommand("select * from db",conn)
conn.open()
dim dr as oledbdatareader
dr=comm.executereader()
dg.datasource=dr
dg.databind()
dr.close()
conn.close()
%>
<asp:datagrid id="dg" runat="server"></asp:datagrid>
或者:
<%@import namespace=system.data%>
<%@import namespace=system.data.oledb%>
<html>
<head>
<title>ASP.net开发</title>
</head>
<body>
<%
dim conn as new oledbconnection("provider=microsoft.jet.oledb.4.0;data source="+server.mappath("db.mdb"))
dim comm as new oledbcommand("select * from db",conn)
conn.open()
dim dr as oledbdatareader
dr=comm.executereader()
response.write("<table align=center border=1 bordercolor=red cellspacing=0>")
response.write("<tr>")
dim i as integer
for i=0 to dr.fieldcount-1
response.write("<td>")
response.write(dr.getname(i))
response.write("</td>")
next
response.write("</tr>")
dim arr(dr.fieldcount-1)
while dr.read
response.write("<tr>")
dr.getvalues(arr)
for i=0 to arr.length-1
response.write("<td>")
response.write(arr(i))
response.write("</td>")
next
response.write("</tr>")
end while
response.write("</table>")
dr.close()
conn.close()
%>
</body>
</html>
或者:
<%@import namespace=system.data%>
<%@import namespace=system.data.oledb%>
<%
dim da as new oledbdataadapter("select * from db","provider=microsoft.jet.oledb.4.0;data source="+server.mappath("db.mdb"))
dim ds as new dataset
da.fill(ds,"tablename")
dg.datasource=ds.tables("tablename")
dg.databind()
%>
<asp:datagrid id="dg" runat="server" align=center></asp:datagrid> |
2009年08月09日 星期日 11:09
'必须引用microsoft activex data objects 2.0 library
private conn as new adodb.connection
private rs as new adodb.recordset
private sub form_load()
set conn=createobject("adodb.connection")
set rs=createobject("adodb.recordset")
conn.open "provider=microsoft.jet.oledb.4.0;data source="+app.path+"\db.mdb"
rs.open "select * from db",conn,1,1
msgbox rs("name")
end sub |
2009年08月08日 星期六 09:54
在一模块内写上如下代码(此模块的名字不用改)
public server as object
public session as object
public request as object
public response as object
public application as object
在类模块内先写下如下代码(假设工程的名称为xxfaxy,类模块的名称为mf)
public function initialize(server as object,session as object,request as object,response as object,application as object) as boolean
set xxfaxy.server=server
set xxfaxy.session=session
set xxfaxy.request=request
set xxfaxy.response=response
set xxfaxy.application=application
end function
接下来可以写其他代码了
在asp中调用方法组件的方法如下
<%
set system=server.createobject("xxfaxy.mf")
system.initialize server,session,request,response,application
%> |
2009年08月07日 星期五 21:41
必须在首行加上如下代码:
<%@ page aspcompat=true %>
创建对象格式如下:
dim xxfaxy as object
xxfaxy=server.createobject("xxfaxy.mf")
或者
dim xxfaxy as object=server.createobject("xxfaxy.mf")
下面是清除对象:
xxfaxy=nothing
|
2009年08月06日 星期四 18:31
xxfaxy多功能组件使用手册
1.将xxfaxy.dll 文件复制到system32 文件夹
2.在运行里运行regsvr32.exe xxfaxy.dll
3.在ASP 页面中创建对象objname (名称可以自己取),语句如下:
set objname=server.createobject("xxfaxy.mf")
4.使用objname 的方法(所有方法见下表)
5.使用完对象后清除对象,语句为:
set xxfaxy=nothing
xxfaxy多功能(multifunctional)组件方法

函数11 的结果:
2009 年08 月06 日16:53:12 星期四[己丑牛]
其他方法正在更新中,敬请关注群34494928 共享。
下载地址
http://d.namipan.com/d/e0ab132d1506a6b66e858e904d5b09d1190e8de1c0a70000 |
|