This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class SystemCriticalException | |
| : Exception | |
| { | |
| public SystemCriticalException() { } | |
| public SystemCriticalException(string message) | |
| : base(message) { } | |
| public SystemCriticalException(string message, Exception inner) | |
| : base(message, inner) { } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| // you can add with key-value logic your applications' configuration info | |
| Registry.CurrentUser.SetValue("ADMIN_USER_PASSWORD", "12*23.CFGR|234"); | |
| Registry.LocalMachine.SetValue("MY_APP_PRODUCT_KEY", "SD34-5TGB-ER98-D95E"); | |
| Registry.ClassesRoot.SetValue("KEY", "VALUE"); | |
| Registry.Users.SetValue("USER_NAME", "DOMAIN\\KUBRA"); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static class RegistryConfigurator | |
| { | |
| private static RegistryKey baseRegistryKey = Registry.LocalMachine; | |
| public static RegistryKey BaseRegistryKey | |
| { | |
| get { return baseRegistryKey; } | |
| set { baseRegistryKey = value; } | |
| } | |
| private static string subKey = "SOFTWARE\\My-Application"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // in console application | |
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| AppDomain currentDomain = AppDomain.CurrentDomain; | |
| currentDomain.UnhandledException += currentDomain_UnhandledException; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Context | |
| { | |
| public string Value { get; set; } | |
| public int DigitalValue { get; set; } | |
| public Context(string Value) | |
| { | |
| this.Value = Value; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| string txt = "YUNUSEMREKESKIN"; | |
| Context context = new Context(txt); | |
| HexParser parser = new HexParser(context); | |
| parser.Parser(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /// <summary> | |
| /// Generates a sequential guid | |
| /// Based on http://stackoverflow.com/questions/665417/sequential-guid-in-linq-to-sql | |
| /// </summary> | |
| /// <returns></returns> | |
| public class GuidGenerator | |
| { | |
| public static Guid Generate() | |
| { | |
| var destinationArray = Guid.NewGuid().ToByteArray(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| if (args.Length > 0) | |
| { | |
| // First parameter is the source file name. | |
| if (File.Exists(args[0])) | |
| { | |
| CompileExecutable(args[0]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| var productOperation = new ProductOperation(); | |
| var list1 = productOperation.GetPagedProductList(1, 5); | |
| foreach (var item in list1) | |
| Console.WriteLine(item.Id + " - " + item.Name); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| BaseProcessor reportProcessor = new ReportProcessor(); | |
| reportProcessor.ProcessorCompleted += reportProcessor_ProcessorCompleted; | |
| reportProcessor.ProcessorStarting += reportProcessor_ProcessorStarting; | |
| reportProcessor.ProcessorStarted += reportProcessor_ProcessorStarted; |