从任何网站URL搜索文件和文件夹 [英] Search files and folders from any website URL

查看:161
本文介绍了从任何网站URL搜索文件和文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我试图从URL路径folder.那个URL中找到文件,URL可以是任何网站.例如

输入:http://www.dreamincode.net/forums/topic/77912-ftp-download-delete/

首先需要解析该URL并将其检出,该文件夹中是否有任何日志文件或文档文件.该网址不属于本地路径,它可能是第三方网站,例如www.google.com/或其他内容.

在我们的示例中,该文件夹可能是forums,topic和77912-ftp-download-delete

* .log或* .doc这样的..

搜索过程一直持续到URL末尾.我尝试了一些方法,但无法获得解决方案.如果有人知道解决方案,请在此处更新.

预先感谢,

问候,

sasi



i am trying to find the files from the URL path folders.that URL may be any website. for example

Input: http://www.dreamincode.net/forums/topic/77912-ftp-download-delete/

first need to parse that URL and check it out,is there any log files or document files are there within that folder. That URL is not belongs to local path, it may third party site like www.google.com/ or something else.

In our example, that folder may forums , topic and 77912-ftp-download-delete

*.log or *.doc like that..

that searching process going till end of the URL. I tried some of the way but i cant get the solutions. if any body knows the solution, please update here..

thanks in advance,

regards,

sasi

推荐答案


您尝试解析的URL不在本地服务器中吗?如果没有,并且目录浏览处于打开状态,那么有一种方法可以解析HTML并找到所需的文件.但是,如果关闭了目录浏览并且URL是除本地服务器以外的任何URL,那么答案是否定的.由于站点来自不同的服务器,您如何确定URL不是由某种URL重写器生成的?不能保证这些目录结构存在.
但是,如果您尝试解析的URL存在于服务器中,那么我相信您已经有了答案:)
Hi,
Is the URL you are trying to parse is not in your local server? If no and if directory browsing is on, then there is a way to parse the HTML and find the desired file. But if directory browsing is off and also URL is any URL other then your local server, the answer is no. As the site is from different server how you will determine that URL is not generated from some sort of URL re-writer? There is no guarantee that those directory structure exists.
But if URL you are trying to parse exist in your server then I believe you have already got an answer :)


首先,您想使用MapPath方法:

昏暗的路径作为字符串= MapPath(〜/forums/topic/77912-ftp-download-delete");

那应该返回类似"C:\ inetpub \ wwwroot \ dreamincode \ forums \ topic \ 77912-ftp-download-delete"的内容.

然后,使用DirectyInfo对象在要调用MapPath的返回路径中查找要查找的所有文件,这很简单.在这方面,Google是您的朋友.
First, you want to use the MapPath method:

Dim path As string = MapPath("~/forums/topic/77912-ftp-download-delete");

That should return something like "C:\inetpub\wwwroot\dreamincode\forums\topic\77912-ftp-download-delete".

After that it''s a simple matter of using DirectyInfo object to find all of the files you want to find in the path returned from the call to MapPath. Google is your friend in that regard.


您的问题根本不清楚.您是否要获取输入网址的任何网站的文件和文件夹?

还是您正在尝试在自己的网络服务器上执行此操作?
Your question isn''t clear at all. Are you trying to get the files and folders of any website you enter a URL for?

Or are you trying to do this on your own webserver?


这篇关于从任何网站URL搜索文件和文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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