所属类别:Asp
文章作者:未知
特别推荐:免费发布信息 承包关键词~~抢爆了!HOT!
一个在服务器端选择文件的小程序,在要插入服务器端的文件,例如服务器端已经上传的图片,或者是菜单管理中选择要执行的文件,都是有用的,当然,还可以改作它用,就看你的需要了。
限于时间,没能打它做成像windows的打开文件窗口一样的效果,哪位网友做了,告诉一声啊,迟些我自己抽得出时间也会做的,希望能与大家一起进步。<%@ Language=VBScript codePage="936"%><% option explicit %><%function getFileName(strPath)dim filenamefilename = mid(strPath,instrrev(strPath,"\")+1)getFileName = filenameend function%>Noteless Valley(lijun.org)程序示例BODY{font-size: 16px;border-top-style: none;font-family: Verdana, 宋体;border-right-style: none;border-left-style: none;background-color: white;border-bottom-style: none;}A{text-decoration: none;}A:hover{text-decoration: underline;}function selFile(filename) {lblMsg.innerText = filename;}<%dim strSvrPath, strCurrentDirectorystrSvrPath = request.QueryString("path")if strSvrPath = "" thenstrSvrPath = request.ServerVariables("SCRIPT_NAME")strSvrPath = mid(strSvrPath,1,instrrev(strSvrPath,"/"))'在这里设定初始目录,此处我设为根目录end ifstrCurrentDirectory = server.MapPath(strSvrPath)response.Write "当前目录:" & strSvrPath & ""dim fso, folder, subfolder, files, itemset fso = server.CreateObject("scripting.filesystemobject")set folder = fso.GetFolder(strCurrentDirectory)set subfolder = folder.SubFoldersif strSvrPath <> "/" thenresponse.Write "[To Parent Directory]" & ""end iffor each item in subfolderresponse.Write "0" & _getFileName(item) & ""nextset files = folder.Filesfor each item in files'取绝对路径'response.Write "3" & getFileName(item) & ""'取文件名'response.Write "3" & _'getFileName(item) & ""'取相对某目录的相对路径,本例为“/myweb/”response.Write "3" & _getFileName(item) & ""nextset fso = nothing%>关闭本页
相关信息· 学习基类
· validateTextBox:一个自验证TextBox控件(附带c
· How to install E17(enlightenment) in ubuntu8.04
· 设置和修改 X Window 的显示模式
13519
98245
