Loading color scheme

[Source Code] C# True Random Password Generator

password

If you need to generate a bulk amount of passwords you can use one of the widely available websites, use a console generator program, or if you don't trust anyone, you can quickly write your own program. Below is the source code of a True Random password generator written entirely in C#. Compared to similar programs available on the net, which use clock-dependent C# System.Random Number Generator, this code sample uses RNGCryptoServiceProvider which is far more secure and provides unique numbers over a long period of time. Even if you won't notice the difference in generating 1-2 passwords, the RNGCryptoServiceProvider will have more even distribution for thousands of iterations.

TPL_COM_CONTENT_READ_MORE[Source Code] C# True Random Password Generator
How to get Excel Cell text in OpenXML SDK 2.5?

Getting cell text in OpenXML SDK 2.5 is quite tricky because the cell text can be either stored in the cell itself, or in a shared string table. In the latter case, the cell value is just an index to the shared string table. Also, some files have data stored in CellValue, other files have data in the InnerText fields. To address all these variations, I wrote the tiny function to get the cell text in any case:

TPL_COM_CONTENT_READ_MOREHow to get Excel Cell text in OpenXML SDK 2.5?
How to assign hotkeys (stortcuts) to C# Windows Forms Controls?

In the age of web development, programming C# WinForms applications are kind of outdated, but still, many software programmers are involved in developing legacy desktop applications, which will definitely be used for years from now on. Sometimes it is easier to develop a simple WinForms application that is self-sufficient and will just work by itself rather than pay rent for Microsoft Azure or Amazon AWS every month. So, the questions regarding these applications are still actual and demanded. 

When you build a form, the user is required to use the mouse to control it: click the buttons, edit text boxes, checkboxes, etc. But what if you need your form to be controlled just by the keyboard? Is it possible to press a hotkey and activate a specific control in the WinForms application? The answer is yes, and it is quite simple. 

TPL_COM_CONTENT_READ_MOREHow to assign hotkeys (stortcuts) to C# Windows Forms Controls?
How to Read Direct Mouse and Keyboard Events in C++ Console App?

Usually console applications are not associated with interactivity. Most of console apps accept some parameters via command line, do their job and exit. If the interactivity is needed, one has an option to build simple letters-controlled menu. While it is OK for simple applications, it is not enough for interactive applications. An alternative would be to create windowed application, which has richer keyboard and mouse control functionality out-of-the-box. But what to do if you want to stick with console application? Windows can enable your app to receive direct events related to mouse and keyboard sent to your console window.

TPL_COM_CONTENT_READ_MOREHow to Read Direct Mouse and Keyboard Events in C++ Console App?
Get all interesting articles to your inbox
Please wait