|
| Fileobject Fra : Johannes Veje |
Dato : 26-11-02 21:15 |
|
Er der en der kan hjælpe mig med at ændre mit script, så den "KUN" tager
filer med endelsen .pdf ? og ikke alle filer i bibliotektet ?
<%
dim dirtowalk, fs, f, fc, whatever
dirtowalk="../bestyrelse/PDFfiler"
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(server.mappath(dirtowalk))
Set fc = f.Files
For Each whatever in fc
response.write "<A HREF='PDFfiler/"
response.write whatever.name
response.write "'>"
response.write whatever.name
response.write "</A><br>"
Next
%>
mvh
Johs.
| |
Thygesen (26-11-2002)
| Kommentar Fra : Thygesen |
Dato : 26-11-02 21:59 |
|
"Johannes Veje" <jv@jv-data.dk> skrev i en meddelelse
news:as0km1$o9k$1@news.cybercity.dk...
> Er der en der kan hjælpe mig med at ændre mit script, så den "KUN" tager
> filer med endelsen .pdf ? og ikke alle filer i bibliotektet ?
>
> <%
> dim dirtowalk, fs, f, fc, whatever
> dirtowalk="../bestyrelse/PDFfiler"
> Set fs = CreateObject("Scripting.FileSystemObject")
> Set f = fs.GetFolder(server.mappath(dirtowalk))
> Set fc = f.Files
> For Each whatever in fc
> response.write "<A HREF='PDFfiler/"
> response.write whatever.name
> response.write "'>"
> response.write whatever.name
> response.write "</A><br>"
> Next
> %>
Ja, du kan bruge følgende:
For Each whatever in fc
fileext = mid(lcase(whatever.name),InstrRev(whatever.name,".")+1)
Select case fileext
case "pdf":
response.write "<A HREF='PDFfiler/"
response.write whatever.name
response.write "'>"
response.write whatever.name
response.write "</A><br>"
End Select
Next
Mvh. Christoffer Thygesen
| |
Johannes Veje (27-11-2002)
| Kommentar Fra : Johannes Veje |
Dato : 27-11-02 06:37 |
|
>
> Ja, du kan bruge følgende:
>
> For Each whatever in fc
> fileext = mid(lcase(whatever.name),InstrRev(whatever.name,".")+1)
> Select case fileext
> case "pdf":
> response.write "<A HREF='PDFfiler/"
> response.write whatever.name
> response.write "'>"
> response.write whatever.name
> response.write "</A><br>"
> End Select
> Next
perfekt, tak for hjælpen
/johs.
| |
|
|