Search files in C# recursively

I found this piece of code to search a for a file that containing a pattern (extension, part of the name)  void DirSearch(string dir, string pattern) {     try     {         foreach (string d in Directory.GetDirectories(dir))         {             foreach (string f in Directory.GetFiles(d, pattern))             {                 Console.WriteLine(“File found: {0}”, f);             }             DirSearch(d);…

4

Get Print Jobs using WMI and ManagmentObjects

I found a way to get the print jobs from the spoiler using Management objects and WMI public static void GetPrintJobs() {     string searchQuery = “SELECT * FROM Win32_PrintJob”;     ManagementObjectSearcher searchPrintJobs = new ManagementObjectSearcher(searchQuery);     ManagementObjectCollection prntJobCollection = searchPrintJobs.Get();     foreach (ManagementObject prntJob in prntJobCollection)     {         try         {             string…

1

How to configure SQL Mirron in SQL Server 2005 sp1

For purposes of ilustrate this method:   PRINCIPAL will be the PRINCIPAL database serverMIRROR      will be the MIRROR database servermyDB         will be the database MIRRORBackup the folder created in PRINCIPAL to store the backups EP5022      will be the endpoint name and I will use the port 5022 to configure it I will create an anonymous login…

3