1. Tomcat做的网站里的数据库配置文件一般放在哪,为什么在classes目录搜索也没有。搜索JDB
你的tomcat安装目录下,conf文件夹下的server.xml是你的服务器配置信息,数据库配置文件一般放在自己的工程里的web.xml或者直接创一个类直接调用,或者用hibernet配置文件
2. access数据库获取文件夹内所有文件名
<%@ Language=VBscript %>
<%
function bianli(path)
dim fso 'fso对象
dim objFolder '文件夹对象
dim objSubFolders '子文件夹集合
dim objSubFolder '子文件夹对象
dim objFiles '文件集合
dim objFile '文件对象
set fso=server.CreateObject("scripting.filesystemobject")
on error resume next
set ōbjFolder=fso.GetFolder(path)'创建文件夹对象
set ōbjSubFolders=objFolder.Subfolders'创建的子文件夹对象
for each objSubFolder in objSubFolders
nowpath=path + "\\" + objSubFolder.name
Response.Write nowpath
set ōbjFiles=objSubFolder.Files
for each objFile in objFiles
Response.Write "<br>---"
Response.Write objFile.name
next
Response.Write "<p>"
bianli(nowpath) '调用递归
next
set ōbjFolder=nothing
set ōbjSubFolders=nothing
set fso=nothing
end function
%>
<%
bianli("F:\") '调用bianli()函数,这里是遍历F:盘
%>遍历某文件夹下文件,并输出为XML<%@ Language=VBscript %>
<%
Response.contentType = "application/xml"
Response.Expires = 0
function bianli(path)
dim fso 'fso对象
dim objFolder '文件夹对象
dim objFiles '文件集合
dim objFile '文件对象 set fso=server.CreateObject("scripting.filesystemobject")
on error resume next
set ōbjFolder=fso.GetFolder(path)'创建文件夹对象
Response.Write "<?xml version=""1.0"" encoding=""GB2312""?>"
Response.Write ("<swf>")
set ōbjFiles=objFolder.Files
for each objFile in objFiles
Response.Write ("<swf game='"&objFile.name&"'/>")
next
Response.Write ("</swf>")
set ōbjFolder=nothing
set ōbjSubFolders=nothing
set fso=nothing
end function
%>
<%
bianli(Server.MapPath("/")+"\pic") '调用bianli()函数,这里是遍历当前目录下的pic文件夹
%> '遍例文件和文件夹,然后自己改改用用