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文件夾
%> '遍例文件和文件夾,然後自己改改用用