Password creation
Q1-Write a console program for password is not like words in dictionary.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
VulpesRank #55 · 29.2K reputationPosted Sep 5, 2014, 7:46 AM EDT
The following program generates random passwords between 8 and 12 characters in length which include exactly two digits. The remaining characters are upper or lower case letters:
/* sample output - will be different each time of course */
sriballabha Rout11 reputationPosted Sep 8, 2014, 12:00 AM EDT
VulpesRank #55 · 29.2K reputationPosted Sep 8, 2014, 2:19 AM EDT
The following assumes you're using the MS Word dictionary and .NET 4.0 (VS 2010) or later. To do so you need to add a reference to the Microsoft Word Object Library (version 12.0 or later) which is under the COM tab:
Note that this approach is far from perfect as there are some words (such as countries or well known place names) which won't be in a normal dictionary. You really need to combine potentially suitable words with digits or special characters to produce reasonably strong passwords.