文件和文件夹列表。 [英] File and Folder Listing.

查看:85
本文介绍了文件和文件夹列表。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




不确定这是否是正确的论坛,但希望有人可以帮助我。


我正在创造一些东西我的内联网,我想列出目录的文件和

文件夹,我发现了一些代码来执行此操作。


唯一的问题是它列出了以前的asp文件,如果我去:

" http://myserver/listing.asp"在文件列表中将是许多营销文档中的listing.asp




有没有办法阻止/停止这个文件从上市?


谢谢:)

Hi,

Not sure if this is the right forum, but hopefully someone can help me.

I am creating something for our intranet and i want to list the files and
folders of a directory, i found some code to do this.

The only problem is that it lists the asp file used to for example if i go to:
"http://myserver/listing.asp" In the file listing will be "listing.asp"
amongst a lot of marketing documents.

Is there a way to block/stop this one file from being listed?

Thanks :)

推荐答案

=?Utf-8?B?Q2hyaXM = ?=写于2004年4月4日

microsoft.public.inetserver.asp.general:
=?Utf-8?B?Q2hyaXM=?= wrote on 04 nov 2004 in
microsoft.public.inetserver.asp.general:
不确定这是否是正确的论坛,但希望有人可以帮助
我。

我正在为我们的内部网创建一些内容,我想列出目录中的文件和文件夹,我找到了一些代码来执行此操作。
" listing.asp"很多营销文档中都有。

有没有办法阻止/阻止这个文件被列出?
Not sure if this is the right forum, but hopefully someone can help
me.

I am creating something for our intranet and i want to list the files
and folders of a directory, i found some code to do this.

The only problem is that it lists the asp file used to for example if
i go to: "http://myserver/listing.asp" In the file listing will be
"listing.asp" amongst a lot of marketing documents.

Is there a way to block/stop this one file from being listed?




肯定,=?如果dbData(file)<> listing.asp" response.write dbData(" file")& < br>"

....


-

Evertjan。

荷兰。

(请在我的电子邮件地址中将x'变为点数,

但让我们继续讨论新闻组)



sure, =?U tf-8?B?Q2hyaXM=?=:

....
if dbData("file")<>"listing.asp" response.write dbData("file") & "<br>"
....

--
Evertjan.
The Netherlands.
(Please change the x''es to dots in my emailaddress,
but let us keep the discussions in the newsgroup)


您好Evertjan,


非常感谢您的回复,遗憾的是我无法让它工作:(


下面是我下载的用于列出文件的代码,其中'我应该

i使用你的代码,因为当我插入它时,Expecting Then。 />

设置rstFiles = Server.CreateObject(" ADODB.Recordset")

rstFiles.Fields.Append" name",adVarChar,255

rstFiles.Fields.Append" size",adInteger

rstFiles.Fields.Append" date",adDate

rstFiles.Fields.Append type,adVarChar,255

rstFiles.Open


每个objItem in objFolder.Files


rstFiles.AddNew

rstFiles.Fields(" name")。Value = objItem.Name

rstFiles.Fields(" size")。Value = objItem.Size

rstFiles.Fields(" date")。Value = objItem.DateCreated

rstFiles.Fields(" type")。Value = objItem.Type


下一个''objItem


非常感谢:)


克里斯。


Evertjan。写道:
Hi Evertjan,

Many thanks for your response, unfortunately i cannot get it to work :(

Below is the code I have downloaded to list the files, Where about''s should
i use your code as it says "Expecting Then" when i insert it.

Set rstFiles = Server.CreateObject("ADODB.Recordset")

rstFiles.Fields.Append "name", adVarChar, 255
rstFiles.Fields.Append "size", adInteger
rstFiles.Fields.Append "date", adDate
rstFiles.Fields.Append "type", adVarChar, 255
rstFiles.Open

For Each objItem In objFolder.Files

rstFiles.AddNew
rstFiles.Fields("name").Value = objItem.Name
rstFiles.Fields("size").Value = objItem.Size
rstFiles.Fields("date").Value = objItem.DateCreated
rstFiles.Fields("type").Value = objItem.Type

Next ''objItem

Many Thanks :)

Chris.

"Evertjan." wrote:
=?Utf-8?B?Q2hyaXM =?=写于2004年4月4日的
microsoft.public.inetserver.asp.general:
=?Utf-8?B?Q2hyaXM=?= wrote on 04 nov 2004 in
microsoft.public.inetserver.asp.general:
不确定这是否是正确的论坛,但希望有人可以帮助我。

我正在为我们的内部网创建一些东西,我想列出文件
和目录的文件夹,我找到了一些代码来执行此操作。

唯一的问题是,它列出了以前使用的asp文件,如果我转到:" http:/ /myserver/listing.asp"在文件列表中将是
" listing.asp"很多营销文档中都有。

有没有办法阻止/阻止这个文件被列出?
Not sure if this is the right forum, but hopefully someone can help
me.

I am creating something for our intranet and i want to list the files
and folders of a directory, i found some code to do this.

The only problem is that it lists the asp file used to for example if
i go to: "http://myserver/listing.asp" In the file listing will be
"listing.asp" amongst a lot of marketing documents.

Is there a way to block/stop this one file from being listed?



当然,=?U tf-8 ?B?Q2hyaXM =?=:

....
如果dbData(" file")<>" listing.asp" response.write dbData(" file")& < br>"
....

- Evertjan。
荷兰。
(请更改x''我的电子邮件中的点数,
但让我们继续讨论新闻组。



sure, =?U tf-8?B?Q2hyaXM=?=:

....
if dbData("file")<>"listing.asp" response.write dbData("file") & "<br>"
....

--
Evertjan.
The Netherlands.
(Please change the x''es to dots in my emailaddress,
but let us keep the discussions in the newsgroup)



2004年11月4日星期四04:14:01 -0800,Chris

< Ch *** @ discuss.microsoft.com>写道:
On Thu, 4 Nov 2004 04:14:01 -0800, "Chris"
<Ch***@discussions.microsoft.com> wrote:


不确定这是否是正确的论坛,但希望有人可以帮助我。

我是为我们的内部网创建一些东西,我想列出目录的文件和文件夹,我发现了一些代码来执行此操作。

唯一的问题是它列出了用于的asp文件例如,如果我去:
http://myserver/listing.asp"在文件列表中将是许多营销文档中的listing.asp。

有没有办法阻止/阻止这个文件被列出?
Hi,

Not sure if this is the right forum, but hopefully someone can help me.

I am creating something for our intranet and i want to list the files and
folders of a directory, i found some code to do this.

The only problem is that it lists the asp file used to for example if i go to:
"http://myserver/listing.asp" In the file listing will be "listing.asp"
amongst a lot of marketing documents.

Is there a way to block/stop this one file from being listed?




是的。 :)


最好的方法可能是更好地整理数据,因此需要列出

的文件是文件夹中唯一的文件。但你可以

总是使用IF / THEN来排除任何你想要的东西。例如:


如果文件名<> " listing.asp"那么

{显示列表中的文件}

结束如果


甚至:


IF UCASE(右(文件名,3))<> " ASP"然后


选择没有ASP扩展名的任何东西。


Jeff



Yes. :)

The best method may be to organize your data better, so the files that
need to be listed are the only ones in the folders. But you can
always use an IF/THEN to exclude anything you wish. For example:

IF Filename <> "listing.asp" THEN
{ Display the file in the list }
END IF

Or even:

IF UCASE(RIGHT(Filename,3)) <> "ASP" THEN

To select anything without an ASP extension.

Jeff


这篇关于文件和文件夹列表。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆