public static void Main()
{
int num;
try
{
Console.WriteLine("Flock Console app.");
Console.WriteLine("Created By Rukshan Ranatunge for sb2team \x00a4\x00a4\x00a4\x00a4\x00a4\x00df\x00df\x00d5\x00d5\x00d5\x00d5\x00d5\x00ae\x00ae\x00ae\x00ae");
Console.WriteLine("2010/02/03 9:10 Am");
Console.WriteLine("Locks or Unlocks Windows Folders");
Console.WriteLine(" e Mail : [EMAIL="[email protected]"][email protected][/EMAIL]");
Console.WriteLine("");
Console.WriteLine("Type exit to close this program");
do
{
Console.WriteLine("");
Console.WriteLine("Enter Target Folder Path : ");
string path = Console.ReadLine();
if (StringType.StrCmp(path, "exit", false) != 0)
{
if (Directory.Exists(path))
{
string str2;
Console.WriteLine("");
Console.WriteLine("Folder you selected : " + path);
Console.WriteLine("Forlder Created : " + StringType.FromDate(Directory.GetCreationTime(path)));
Console.WriteLine("Folder last accessed : " + StringType.FromDate(Directory.GetLastAccessTime(path)));
Console.WriteLine("Last written in folder : " + StringType.FromDate(Directory.GetLastWriteTime(path)));
Console.WriteLine("");
do
{
num = 10;
Console.WriteLine("Are you sure to lock this folder : (y/n)");
str2 = Console.ReadLine();
if (StringType.StrCmp(str2, "y", false) == 0)
{
FileSystem.Rename(path, path + ".{e17d4fc0-5564-11d1-83f2-00a0c90dc849}");
Console.WriteLine("LOCKED");
Console.WriteLine("Created by RuKsHaN RaNaTuNgE");
break;
}
}
while (StringType.StrCmp(str2, "n", false) != 0);
}
else if (!Directory.Exists(path))
{
string str3 = path + ".{e17d4fc0-5564-11d1-83f2-00a0c90dc849}";
if (Directory.Exists(str3))
{
string str4;
Console.WriteLine("");
Console.WriteLine("Folder you selected : " + path);
Console.WriteLine("Could not get information. This folder is locked");
Console.WriteLine("");
do
{
num = 11;
Console.WriteLine("Are you sure to unlock this folder : (y/n)");
str4 = Console.ReadLine();
if (StringType.StrCmp(str4, "y", false) == 0)
{
FileSystem.Rename(str3, path);
Console.WriteLine("UNLOCKED");
Console.WriteLine("Created by RuKsHaN RaNaTuNgE");
break;
}
}
while (StringType.StrCmp(str4, "n", false) != 0);
}
else
{
Console.WriteLine("Folder Does Not Exists");
Console.ReadLine();
}
}
}
}
while (1 != 0);
}
catch (Exception exception1)
{
ProjectData.SetProjectError(exception1, num);
Exception exception = exception1;
Console.WriteLine("Error : " + exception.Message + " Press any key");
Console.ReadLine();
ProjectData.ClearProjectError();
}
}