HIRASE CONNECTION WK

programming collection

目次

Blog 利用状況

ニュース

書庫

日記カテゴリ

Link Collection

未来ファイルを探せ。

先ほどの日記「いつもリビルドの恐怖」を書いた後に作った、 未来時刻のタイムスタンプを持つファイルをリストアップするツールのソースを公開しておきます。

C# Visual Studio 2008で作成。

using System;
using System.Collections.Generic;
using System.Text;

namespace FindFileFromFuture
{
    class Program
    {
        System.DateTime nowTime = System.DateTime.Now;

        public System.DateTime NowTime
        {
            get { return this.nowTime; }
            set { this.nowTime = value; }
        }

        static void Main(string[] args)
        {
            Program p = new Program();
            Console.WriteLine("Now Time: " + p.NowTime);
            Int64 fileNum = p.FindFileFromFuture(@".\");
            Console.WriteLine("Number of Checked file: " + fileNum);
            Console.WriteLine("Push any key");
            Console.ReadKey();
        }

        public Int64 FindFileFromFuture(String directory)
        {
            Int64 fileNum = 0;
            String[] fileNames = System.IO.Directory.GetFiles(directory);
            foreach (String fileName in fileNames)
            {
                System.IO.FileInfo fileInfo = new System.IO.FileInfo(fileName);
                DateTime lastWriteTime = fileInfo.LastWriteTime;
                TimeSpan timeSpan = this.nowTime.Subtract(lastWriteTime);
                if (timeSpan.Ticks < 0)
                {
                    Console.WriteLine("Found: " + fileName);
                    Console.WriteLine("\tLast write time: " + lastWriteTime);
                }
                fileNum++;
            }

            String[] childDirectories = System.IO.Directory.GetDirectories(directory);
            foreach (String childDirectory in childDirectories)
            {
                fileNum += FindFileFromFuture(childDirectory);
            }

            return fileNum;
        }
    }
}

投稿日時 : 2008年2月19日 15:03

コメントを追加

# If you are going for finest contents like myself, just pay a quick visit this website daily for the reason that it presents quality contents, thanks 2018/10/04 13:16 If you are going for finest contents like myself,

If you are going for finest contents like myself, just pay a quick visit this website daily for the reason that it presents quality contents, thanks

# My partner and I stumbled over here coming from a different page and thought I might as well check things out. I like what I see so now i am following you. Look forward to exploring your web page repeatedly. 2018/10/16 16:49 My partner and I stumbled over here coming from a

My partner and I stumbled over here coming from a different
page and thought I might as well check things out.
I like what I see so now i am following you. Look forward to exploring your web page repeatedly.

# What's up colleagues, its wonderful post on the topic of cultureand fully defined, keep it up all the time. 2018/11/03 6:32 What's up colleagues, its wonderful post on the to

What's up colleagues, its wonderful post on the topic of cultureand fully defined, keep it up all the time.

# It's going to be end of mine day, but before finish I am reading this fantastic post to improve my experience. 2018/11/04 16:46 It's going to be end of mine day, but before finis

It's going to be end of mine day, but before finish I am reading this fantastic post to improve my experience.

# I love reading through a post that can make people think. Also, many thanks for allowing me to comment! 2021/08/24 0:45 I love reading through a post that can make people

I love reading through a post that can make people think.

Also, many thanks for allowing me to comment!

# I love reading through a post that can make people think. Also, many thanks for allowing me to comment! 2021/08/24 0:46 I love reading through a post that can make people

I love reading through a post that can make people think.

Also, many thanks for allowing me to comment!

# I love reading through a post that can make people think. Also, many thanks for allowing me to comment! 2021/08/24 0:47 I love reading through a post that can make people

I love reading through a post that can make people think.

Also, many thanks for allowing me to comment!

# I love reading through a post that can make people think. Also, many thanks for allowing me to comment! 2021/08/24 0:48 I love reading through a post that can make people

I love reading through a post that can make people think.

Also, many thanks for allowing me to comment!

# I'd like to find out more? I'd like to find out more details. 2021/08/25 19:36 I'd like to find out more? I'd like to find out mo

I'd like to find out more? I'd like to find
out more details.

# I'd like to find out more? I'd like to find out more details. 2021/08/25 19:37 I'd like to find out more? I'd like to find out mo

I'd like to find out more? I'd like to find
out more details.

# I'd like to find out more? I'd like to find out more details. 2021/08/25 19:38 I'd like to find out more? I'd like to find out mo

I'd like to find out more? I'd like to find
out more details.

# I'd like to find out more? I'd like to find out more details. 2021/08/25 19:39 I'd like to find out more? I'd like to find out mo

I'd like to find out more? I'd like to find
out more details.

# Hi there, I discovered your website by way of Google even as looking for a related matter, your website came up, it seems to be good. I've bookmarked it in my google bookmarks. Hello there, just became aware of your weblog through Google, and located 2021/09/12 14:52 Hi there, I discovered your website by way of Goog

Hi there, I discovered your website by way of Google even as looking
for a related matter, your website came up, it seems to be good.
I've bookmarked it in my google bookmarks.
Hello there, just became aware of your weblog through Google, and
located that it is really informative. I am gonna be careful for brussels.
I will be grateful for those who continue this in future.
Lots of other folks will probably be benefited from
your writing. Cheers! quest bars https://www.iherb.com/search?kw=quest%20bars quest bars

# Hi there, I discovered your website by way of Google even as looking for a related matter, your website came up, it seems to be good. I've bookmarked it in my google bookmarks. Hello there, just became aware of your weblog through Google, and located 2021/09/12 14:53 Hi there, I discovered your website by way of Goog

Hi there, I discovered your website by way of Google even as looking
for a related matter, your website came up, it seems to be good.
I've bookmarked it in my google bookmarks.
Hello there, just became aware of your weblog through Google, and
located that it is really informative. I am gonna be careful for brussels.
I will be grateful for those who continue this in future.
Lots of other folks will probably be benefited from
your writing. Cheers! quest bars https://www.iherb.com/search?kw=quest%20bars quest bars

# Hi there, I discovered your website by way of Google even as looking for a related matter, your website came up, it seems to be good. I've bookmarked it in my google bookmarks. Hello there, just became aware of your weblog through Google, and located 2021/09/12 14:54 Hi there, I discovered your website by way of Goog

Hi there, I discovered your website by way of Google even as looking
for a related matter, your website came up, it seems to be good.
I've bookmarked it in my google bookmarks.
Hello there, just became aware of your weblog through Google, and
located that it is really informative. I am gonna be careful for brussels.
I will be grateful for those who continue this in future.
Lots of other folks will probably be benefited from
your writing. Cheers! quest bars https://www.iherb.com/search?kw=quest%20bars quest bars

# Hi there, I discovered your website by way of Google even as looking for a related matter, your website came up, it seems to be good. I've bookmarked it in my google bookmarks. Hello there, just became aware of your weblog through Google, and located 2021/09/12 14:55 Hi there, I discovered your website by way of Goog

Hi there, I discovered your website by way of Google even as looking
for a related matter, your website came up, it seems to be good.
I've bookmarked it in my google bookmarks.
Hello there, just became aware of your weblog through Google, and
located that it is really informative. I am gonna be careful for brussels.
I will be grateful for those who continue this in future.
Lots of other folks will probably be benefited from
your writing. Cheers! quest bars https://www.iherb.com/search?kw=quest%20bars quest bars

# When I initially commented I clicked the "Notify me when new comments are added" checkbox and now each time a comment is added I get several emails with the same comment. Is there any way you can remove people from that service? Cheers! 2021/12/07 11:09 When I initially commented I clicked the "Not

When I initially commented I clicked the "Notify me when new comments are added" checkbox and
now each time a comment is added I get several emails with the same comment.
Is there any way you can remove people from that service?
Cheers!

# Its like you read my mind! You seem to understand a lot approximately this, such as you wrote the ebook in it or something. I believe that you could do with some p.c. to force the message house a little bit, but instead of that, that is great blog. An ex 2021/12/23 0:25 Its like you read my mind! You seem to understand

Its like you read my mind! You seem to understand a lot approximately this, such as
you wrote the ebook in it or something. I believe that you could do with some p.c.
to force the message house a little bit, but instead of that,
that is great blog. An excellent read. I will certainly be back.

# Its like you read my mind! You seem to understand a lot approximately this, such as you wrote the ebook in it or something. I believe that you could do with some p.c. to force the message house a little bit, but instead of that, that is great blog. An ex 2021/12/23 0:26 Its like you read my mind! You seem to understand

Its like you read my mind! You seem to understand a lot approximately this, such as
you wrote the ebook in it or something. I believe that you could do with some p.c.
to force the message house a little bit, but instead of that,
that is great blog. An excellent read. I will certainly be back.

# Its like you read my mind! You seem to understand a lot approximately this, such as you wrote the ebook in it or something. I believe that you could do with some p.c. to force the message house a little bit, but instead of that, that is great blog. An ex 2021/12/23 0:27 Its like you read my mind! You seem to understand

Its like you read my mind! You seem to understand a lot approximately this, such as
you wrote the ebook in it or something. I believe that you could do with some p.c.
to force the message house a little bit, but instead of that,
that is great blog. An excellent read. I will certainly be back.

# Its like you read my mind! You seem to understand a lot approximately this, such as you wrote the ebook in it or something. I believe that you could do with some p.c. to force the message house a little bit, but instead of that, that is great blog. An ex 2021/12/23 0:27 Its like you read my mind! You seem to understand

Its like you read my mind! You seem to understand a lot approximately this, such as
you wrote the ebook in it or something. I believe that you could do with some p.c.
to force the message house a little bit, but instead of that,
that is great blog. An excellent read. I will certainly be back.

タイトル  
名前  
URL
コメント