English 中文(简体)
传统文化协会 服务器公开目录
原标题:Classic ASP Open directory on server

I want to open a directory, that sits on a server, through a link. My problem is that it works perfectly in an .htm page but not in an .asp page. Here is what i use:

<a href="file://server/folder/folder/folder" target="_blank">Foldername</a>

I have tried using 3 or 5 slashes after the file: but the same result. A different thing i found without result is:

<a href="file://server/folder/folder" onclick="window.open(this.href,  popupwindow ,  width=400,height=300,scrollbars,resizable ); return false;">Link</a>

在试图在html中标出之后,我尝试用下列文字:

<%
str_url="file://server/folder/folder"
Response.Write("<script>") 
Response.Write("window.open( " & str_url & " ,  myWin , height=800,width=1024,status=yes,toolbar=yes,menubar=yes,location=yes,resizable=yes,scrollbars=yes );") 
Response.Write("</script>")
%>

但是,在几次试图打工时,我仍然禁止我反对隔离墙。 这或许在IIS7中是一种残疾功能吗? 还是缺少东西?

Thanks in advance

最佳回答

文档“风格链接”只供你在当地机器上工作,你不能在使用这种方法的远程服务器上打开一个文件夹。 (除非这条道路能够从您的当地机器、服务器份额或某种用途中获取)

问题回答

显示名录的一些样本代码:

<table cellspacing="0">
    <tr>
        <th style="width: 25px">&nbsp;</th>
        <th>Document</th>
        <th style="width: 60px">Size</th>
    </tr>
    <%
    Dim iCounter, iFileSize
    Dim oFS, oFL
    Dim sDirectory

    sDirectory = "directory/you/want"
    iCounter = 0

    Set oFS = Server.CreateObject("Scripting.FileSystemObject")
    Set oFL = oFS.GetFolder(Server.MapPath(sDirectory))

    For Each oF In oFL.Files
        iCounter = iCounter + 1

        iFileSize = FormatNumber(CLng(oF.Size) / 1024 / 1024, 2)
    %>
    <tr>
        <td><%=iCounter %>.</td>
        <td><a href="<%=sDirectory %>/<%=oF.Name %>" target="_blank"><%=oF.Name %></a></td>
        <td><%=iFileSize %> MiB</td>
    </tr>
    <%
    Next
    %>
</table>




相关问题
How to import excel file in web page useing Classic ASP?

We are trying to open an existing excel file (2003) from server location in a web page and save it again in the same location using following syntax. Set ExcelReportApp = CreateObject("Excel....

What s the best method to do paging in my ASP page

What s the best method to do paging in my ASP page when displaying a list of items? I knew that there is no equivalent to MySQL s LIMIT clause present in SQL Server, either 2000 or 2005. How can I ...

Using Classes in a Dictionary in Classic ASP

I usually do C# but have inherited a classic ASP project. I have defined a class: Class clsPayment Public Name End Class Set objPayment = New clsPayment objPayment.Name = "...

Response.Redirect HTTP status code

Why is it that ASP/ASP.NET Response.Redirect uses a HTTP-302 status code ("Moved Temporarily") even though in most cases a HTTP-301 status code ("Moved Permanently") would be more appropriate?

form inside form serialize problem

I am trying to submit a form inside another form because I will need first form s outcome in the second form. I tried using form serialize as advised in some other threads. Problem here is, I dont ...

热门标签