Professional Documents
Culture Documents
using System.IO;
using System.Security.Principal;
using System.Runtime.InteropServices;
namespace FileCheck
{
/// <summary>
/// Summary description for Class1.
/// </summary>
class FileCheck1
{
[DllImport("user32.dll")]
public static extern IntPtr FindWindow(string lpClassName,string
lpWindowName);
[DllImport("user32.dll")]
static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
[DllImport("kernel32.dll")]
public static extern bool SetConsoleTitle(String lpConsoleTitle);
try
{
Flag1 = args[1].ToString();
if(Flag1 == "/h")
{
ShowWindow1 = false;
}
}
catch
{
ShowWindow1 = true;
}
finally
{
setConsoleWindowVisibility(ShowWindow1,"FileCheck");
}
ProcessDir(subdir,recursionLvl+1,r,Index,dtCheck,Visible);
}
catch
{
r.WriteLine(sourceDir + " access denied.");
}
}
return Index.value;
}
public static void setConsoleWindowVisibility(bool visible, string
title)
{
IntPtr hWnd = FindWindow(null, title);
if (hWnd != IntPtr.Zero)
{
if (!visible)
//Hide the window
ShowWindow(hWnd, 0); // 0 = SW_HIDE
else
//Show window again
ShowWindow(hWnd, 1); //1 = SW_SHOWNORMA
}
}
}
}
//Sameple Output
//Started 8/7/2008 11:21:13 AM
//Computer\User Name: MYpc\MYusername
//C:\Program Files\Microsoft Visual Studio .NET 2003\PreEmptive
Solutions\Dotfuscator Community Edition\docs\userguide.pdf 8/7/2002 2:58:48 PM
//C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Tool Developers
Guide\docs\Assembly Metadata Unmanaged API.doc 10/31/2002 12:30:30 AM
//C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Tool Developers
Guide\docs\Debug.doc 10/3/2002 8:46:27 PM
//C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Tool Developers
Guide\docs\DebugRef.doc 7/24/2002 11:32:25 PM
//C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Tool Developers
Guide\docs\DeclarativeSecuritySupport.doc 4/7/2002 11:37:16 PM
//C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Tool Developers
Guide\docs\Hosting Interfaces.doc 10/31/2002 12:30:30 AM
//C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Tool Developers
Guide\docs\ILDasmAdvancedOptions.doc 8/21/2001 2:51:24 PM
//C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Tool Developers
Guide\docs\Metadata Unmanaged API.doc 7/25/2002 5:30:24 PM
//<Number of> files found.
//Finished 8/7/2008 11:21:30 AM