开发者

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 exten开发者_如何学编程sions depending upon the server. How would I determine the extension for a unique sever?

Example Possibilities:

website.com/list.bz2

--or--

website.com/list.gz


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜