Tag

C#

Browsing

J-Lock Encryption Tool is a windows application dedicated to securely encrypt your files. The encryption algorithm that is utilized in this software is well know AES. For the most of the security, this application does not store any password (beware that there is no recovery of the file(s) in case you loose you password). For…

Usually an application needs to save or retrieve data from windows registry. For this reason a registry manager class is required. The following code snippet provides a simple yet effective way for handling windows registry keys. public class Manager { public void addRegistry(string subkey, string name, string value) { if (Microsoft.Win32.Registry.GetValue(@””+subkey, name, null) == null)…

What is the right way to take screenshots using C#? It’s certainly possible to grab a screenshot using the .NET Framework. The following code snippet provides a C# class for capturing and saving screenshots. public class Screenshot { public DateTime timestamp; public Bitmap bitmap; public Screenshot(DateTime timestamp, Bitmap bitmap) { this.timestamp = timestamp; this.bitmap =…

We are often used to call methods dynamically. You can invoke methods of a class instance using reflection, doing a dynamic method invocation. The following code snipped presents an easy way of invocation in C#. public void Execute(string methodName, object[] args) { if (GetType().GetMethod(methodName)) != null) { MethodInfo method = GetType().GetMethod(methodName); method.Invoke(this, new object[] {…