ASP数据库连接方式大全(18)
fso.DeleteFolder ("C:\Bogus")
Response.Write "Deleted folder C:\Bogus" & "<br/>"
End Sub
下面的示例显示如何在 JScript 中使用 Folder 和 FileSystemObject 对象:
function ShowFolderInfo()
{
var fso, fldr, s = "";
// 获得 FileSystemObject 的实例。
fso = new ActiveXObject("Scripting.FileSystemObject");
// 获得 Drive 对象。
fldr = fso.GetFolder("c:");
// 打印父文件夹名。
Response.Write("Parent folder name is: " + fldr + "<br/>");
// 打印驱动器名字。
Response.Write("Contained on drive " + fldr.Drive + "<br/>");
// 打印根文件名。
if (fldr.IsRootFolder)
Response.Write("This is the root folder.");
else
Response.Write("This folder isn't a root folder.");
Response.Write("<br/><br/>");
// 用 FileSystemObject 对象创建新的文件夹。
fso.CreateFolder ("C:\\Bogus");
Response.Write("Created folder C:\\Bogus" + "<br/>");
// 打印文件夹的基本名。
Response.Write("Basename = " + fso.GetBaseName("c:\\bogus") + "<br/>");
// 删除新创建的文件夹。
fso.DeleteFolder ("C:\\Bogus");
Response.Write("Deleted folder C:\\Bogus" + "<br/>");
}
ASP分页函数
Function ExportPageInfo(ByRef rs,curpage,i,LinkFile)
Dim retval, j, pageNumber, BasePage
retval = "第" & curpage & "页/总" & rs.pagecount & "页 "
retval = retval & "本页" & i & "条/总" & rs.recordcount & "条 "
If curpage = 1 Then
retval = retval & "首页 前页 "
Else
retval = retval & "<a href='" & LinkFile & "page=1'>首页</a> <a href='" & LinkFile & "page=" & cstr(curpage - 1) & "'>前页</a> "
End If
If curpage = rs.pagecount Then
retval = retval & "后页 末页"
Else
retval = retval & "<a href='" & LinkFile & "page=" & cstr(curpage + 1) & "'>后页</a> <a href='" & LinkFile & "page=" & cstr(rs.pagecount) & "'>末页</a>"
End if
retval = retval & "<br/>"
BasePage = (curpage \ 10) * 10
内容版权声明:除非注明,否则皆为本站原创文章。