daily pastebin goal
38%
SHARE
TWEET

NTFSFileSystemTunneling

mattezell Mar 12th, 2013 199 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.IO;
  3. namespace AnswerToTheUltimateQuestion
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             var aFile = "QuestionOfLifeTheUniverseAndEverything.txt";
  10.             File.Create(aFile).Close();
  11.             FileInfo info = new FileInfo(aFile);
  12.             DateTime fileOneActualCreationTime = DateTime.Now;
  13.             DateTime  fileOneMetaCreationTime = info.CreationTime;
  14.             File.Delete(aFile);
  15.             Console.Write(string.Format("{0} Created and Deleted File.. Waiting 5 Seconds...", DateTime.Now.ToLongTimeString()));
  16.             System.Threading.Thread.Sleep(5000);
  17.             if(!File.Exists(aFile))
  18.             {
  19.                 File.Create(aFile).Close();
  20.                 info = new FileInfo(aFile);
  21.                 DateTime fileTwoActualCreationTime = DateTime.Now;
  22.                 DateTime  fileTwoMetaCreationTime = info.CreationTime;
  23.                 if (fileOneMetaCreationTime != fileTwoMetaCreationTime)
  24.                 {
  25.                     Console.Write("42");
  26.                 }
  27.                 else
  28.                 {
  29.                     Console.Write("\nWhat is 'reality'?");
  30.                     Console.Write(String.Format("\nFile One and Two Meta Creation Time: {0}", fileTwoMetaCreationTime.ToLongTimeString()));
  31.                 }
  32.                 Console.Write(String.Format("\nFile One Actual Creation Time: {0}", fileOneActualCreationTime.ToLongTimeString()));
  33.                 Console.Write(String.Format("\nFile Two Actual Creation Time: {0}", fileTwoActualCreationTime.ToLongTimeString()));
  34.                 if (fileOneActualCreationTime != fileTwoActualCreationTime)
  35.                     Console.Write("\nThese are clearly 2 different files, created at 2 different times...");
  36.             }
  37.             Console.ReadLine();
  38.         }
  39.     }
  40. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top