asp查看服务器服务器目录(asp查看服务器服务器目录内容)
- 服务器
- 2022-12-18 20:59:24
- 28
今天给各位分享asp查看服务器服务器目录的知识,其中也会对asp查看服务器服务器目录内容进行解释,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!
本文目录一览:
- 1、asp获取服务器一目录下的所有图片的文件名
- 2、asp如何查看服务器根目录下特定的子文件夹,然后显示这个特定文夹中的内容,并能下载这些内容
- 3、ASP.NET获取服务器目录的几个方法
- 4、小旋风asp服务器的文件目录在哪了?
- 5、如何进入asp的上一级目录,我的apache搭建的WEB服务器不认识..,有什么办法吗?
- 6、asp中如何找到服务器中一个共享的网络位置
asp获取服务器一目录下的所有图片的文件名
%
'以下为修改内容
Const UploadDir="/picture/" '存放文件的目录
Const Up="/picture/" '存放文件的目录
Const MaxPerPage=30 '每页显示数量
const Webpage="时尚网页图片" '标题
'检查组件是否已经安装
Function IsObjInstalled(strClassString)
IsObjInstalled = False
Err = 0
Dim xTestObj
Set xTestObj = Server.CreateObject(strClassString)
If 0 = Err Then IsObjInstalled = True
Set xTestObj = Nothing
Err = 0
End Function
dim strFileName
dim totalPut,CurrentPage,TotalPages
dim TruePath,fso,theFolder,theFile,whichfile,thisfile,FileCount,TotleSize
strFileName="?"
if request("page")"" then
currentPage=cint(request("page"))
else
currentPage=1
end if
TruePath=Server.MapPath(UploadDir)
If not IsObjInstalled("Scripting.FileSystemObject") Then
Response.Write "bfont color=red你的服务器不支持 FSO(Scripting.FileSystemObject)! 不能使用本功能/font/b"
Else
set fso=CreateObject("Scripting.FileSystemObject")
if fso.FolderExists(TruePath)then
FileCount=0
TotleSize=0
Set theFolder=fso.GetFolder(TruePath)
For Each theFile In theFolder.Files
FileCount=FileCount+1
TotleSize=TotleSize+theFile.Size
next
totalPut=FileCount
if currentpage1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPagetotalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showContent
showpage2 strFileName,totalput,MaxPerPage
response.write "brdiv align='center'本页共显示 b" FileCount-1 "/b 个图片,占用 b" TotleSize\1024 "/b K/div"
else
if (currentPage-1)*MaxPerPagetotalPut then
showContent
showpage2 strFileName,totalput,MaxPerPage
response.write "brdiv align='center'本页共显示 b" FileCount-1 "/b 个图片,占用 b" TotleSize\1024 "/b K/div"
else
currentPage=1
showContent
showpage2 strFileName,totalput,MaxPerPage
response.write "brdiv align='center'本页共显示 b" FileCount-1 "/b 个图片,占用 b" TotleSize\1024 "/b K/divbrbr"
end if
end if
else
response.write "找不到文件夹!可能是配置有误!"
end if
end if
sub showContent()
dim c
FileCount=1
TotleSize=0
%
TABLE cellSpacing=5 cellPadding=5 border=0
TBODY
TR bgColor=#ffffff
% For Each theFile In theFolder.Files
c=c+1
if FileCountMaxPerPage then
exit for
elseif cMaxPerPage*(CurrentPage-1) then %
TD align=middle width="138"
img src=%=(UploadDir theFile.Name)% border=0br
%
dim str
str=""(theFile.Name)""
str1=str
str2=str
str=replace(str,".jpg","")
if instr(1,str,"/")0 then
str=split(str,"/")
str1=str(0)
end if
%%=str%
/td
% if FileCount mod 5 =0 then%
/TR
TR bgColor=#ffffff
%end if%
% FileCount=FileCount+1
TotleSize=TotleSize+theFile.Size
end if
Next
%
/tr/TBODY/table
%
end sub
sub showpage2(sfilename,totalnumber,maxperpage)
dim n, i,strTemp
if totalnumber mod maxperpage=0 then
n= totalnumber \ maxperpage
else
n= totalnumber \ maxperpage+1
end if
strTemp= "TABLE cellSpacing=1 cellPadding=1 border=0 align='center'TR bgColor=#ffffffform name='showpages' method='Post' action='" sfilename "'td align='center'"
strTemp=strTemp "共 b" totalnumber "/b 个图片 "
if CurrentPage2 then
strTemp=strTemp "首页 上一页 "
else
strTemp=strTemp "a href='" sfilename "page=1'首页/a "
strTemp=strTemp "a href='" sfilename "page=" (CurrentPage-1) "'上一页/a "
end if
if n-currentpage1 then
strTemp=strTemp "下一页 尾页"
else
strTemp=strTemp "a href='" sfilename "page=" (CurrentPage+1) "'下一页/a "
strTemp=strTemp "a href='" sfilename "page=" n "'尾页/a"
end if
strTemp=strTemp " 页次:strongfont color=red" CurrentPage "/font/" n "/strong页 "
strTemp=strTemp " b" maxperpage "/b" "个图片/页"
strTemp=strTemp " 转到:select name='page' size='1' onchange='javascript:submit()'"
for i = 1 to n
strTemp=strTemp "option value='" i "'"
if cint(CurrentPage)=cint(i) then strTemp=strTemp " selected "
strTemp=strTemp "第" i "页/option"
next
strTemp=strTemp "/select"
strTemp=strTemp "/td/form/tr/table"
response.write strTemp
end sub
%
asp如何查看服务器根目录下特定的子文件夹,然后显示这个特定文夹中的内容,并能下载这些内容
解释详细一些啊..根目录指的是磁盘根目录 还是public_html?
----
..我看分数好多以为是要读磁盘根目录
既然是网站根目录那么这个文件夹就会有other 的read权限啊
剩下就是如何调用函数的问题了,你可以用FSO
ASP.NET获取服务器目录的几个方法
编写程序的时候,经常需要用的项目根目录。自己总结如下
1、取得控制台应用程序的根目录方法
方法1、Environment.CurrentDirectory 取得或设置当前工作目录的完整限定路径
方法2、AppDomain.CurrentDomain.BaseDirectory 获取基目录,它由程序集冲突解决程序用来探测程序集
2、取得Web应用程序的根目录方法
方法1、HttpRuntime.AppDomainAppPath.ToString();//获取承载在当前应用程序域中的应用程序的应用程序目录的物理驱动器路径。用于App_Data中获取
方法2、Server.MapPath("") 或者 Server.MapPath("~/");//返回与Web服务器上的指定的虚拟路径相对的物理文件路径
方法3、Request.ApplicationPath;//获取服务器上ASP.NET应用程序的虚拟应用程序根目录
3、取得WinForm应用程序的根目录方法
1、Environment.CurrentDirectory.ToString();//获取或设置当前工作目录的完全限定路径
2、Application.StartupPath.ToString();//获取启动了应用程序的可执行文件的路径,不包括可执行文件的名称
3、Directory.GetCurrentDirectory();//获取应用程序的当前工作目录
4、AppDomain.CurrentDomain.BaseDirectory;//获取基目录,它由程序集冲突解决程序用来探测程序集
5、AppDomain.CurrentDomain.SetupInformation.ApplicationBase;//获取或设置包含该应用程序的目录的名称
其中:以下两个方法可以获取执行文件名称
1、Process.GetCurrentProcess().MainModule.FileName;//可获得当前执行的exe的文件名。
2、Application.ExecutablePath;//获取启动了应用程序的可执行文件的路径,包括可执行文件的名称
小旋风asp服务器的文件目录在哪了?
一般默认是在C盘的WWWROOT,你可以打开IIS看看,其实任意的目录都可以的,设置主目录就可以了!
如何进入asp的上一级目录,我的apache搭建的WEB服务器不认识..,有什么办法吗?
在服务器的注册表编辑器中查找 EnableParentPaths 字串
WindowsXP 中的位置是 HKEY_LOCAL_MACHINE\SOFTWARE\ChiliSoft\ChiliAsp\Parameters
将其值改为 1
再重启apache就可以了
asp中如何找到服务器中一个共享的网络位置
准备工作
1.共享资源服务器为 ShareServer,IP地址为:192.168.100.10;
2.Web服务器为 WebServer,IP地址为:192.168.100.20
详细步骤:
一、共享账户的建立
1.在WebServer上建立一个用户名,方便使用该用户读取ShareServer上的共享目录,我们可以直接把该用户归入IIS_IUSRS组内。在这里我们建立名IIS_SHARED,密码123456;
2.在ShareServer中也建立一个同名的密码的用户(必须一致,否则在UNC验证的时候会无法登陆)。这里用户名也应该为 IIS_SHARED,密码为 123456,也归入IIS_IUSRS组中;
二、共享位置的建立
ShareServer 中使用文件夹共享工具,共享出一个目录,共享名为 web,共享权限设置为 Administrators 组 读取+写入,IIS_SHARED用户 读取(如果需要存东西,就加上 写入 权限);
这里 Administrators 用户必须拥有 读取+写入 权限,否则在 WebServer 里使用IIS直接设置的时候会提示无法保存设置。
共享位置的文件夹安全设置也必须加入 IIS_SHARED的 读取运行 权限
Window2008 文件夹共享需要设置一下,不像XP那么简单,这方面的资料蛮多的,我就不累赘了^_^;
三、IIS中引用共享目录
WebServer 中IIS里建立站点或虚拟目录,路径指向 \\192.168.100.10\web,连接认证用户手动输入为 IIS_SHARED,密码 123456。
当第1步完成的时候,您已经通过web方式访问该站点或虚拟目录中的来自 ShareServer 共享目录的资源,但是 ASP.Net 还没有权限执行。
asp查看服务器服务器目录的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于asp查看服务器服务器目录内容、asp查看服务器服务器目录的信息别忘了在本站进行查找喔。
本文由admin于2022-12-18发表在靑年PHP官网,如有疑问,请联系我们。
本文链接:https://qnphp.com/post/4664.html