简体   繁体   English

如何在服务器上搜索特定文件?

[英]How to go about searching a server for a specific file?

I am attempting to find a specific file on a web(site/server), and this file could have varying extensions depending upon the server. 我试图在Web(站点/服务器)上找到特定文件,并且该文件的扩展名可能会因服务器而异。 How would I determine the extension for a unique sever? 如何确定唯一服务器的扩展名?

Example Possibilities: 可能的示例:

website.com/list. website.com/list。 bz2 bz2

--or-- - 要么 -

website.com/list. website.com/list。 gz z

using System;
using System.IO;

class App
{
    public static void Main()
    {
        string searchPath = @"c:\";
        string searchPattern = "list.*";

        DirectoryInfo di = new DirectoryInfo(searchPath);
        FileInfo[] files = di.GetFiles(searchPattern, SearchOption.AllDirectories);

        foreach (FileInfo file in files)
            Console.WriteLine(file.FullName);

        Console.WriteLine("Press any key to exit...");
        Console.ReadKey();
    }
}

If you don't have access to server and want to search it as a anonymous client, then you should search internet for google hacking . 如果您无权访问服务器并希望以匿名客户端的身份进行搜索,则应在Internet上搜索google hacking

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM