├── .gitattributes
├── .gitignore
├── C#pic.png
├── GIF.gif
├── Password_Genetator
├── PasswordGenerator
│ ├── Password.cs
│ ├── PasswordGenerator.csproj
│ └── Properties
│ │ └── AssemblyInfo.cs
├── Password_Genetator.sln
└── TesePasswordGenerator
│ ├── App.config
│ ├── Program.cs
│ ├── Properties
│ └── AssemblyInfo.cs
│ └── TestPasswordGenerator.csproj
├── README.md
├── giphy.gif
├── my.JPG
└── passwordsnippet.JPG
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 |
4 | # User-specific files
5 | *.suo
6 | *.user
7 | *.userosscache
8 | *.sln.docstates
9 |
10 | # User-specific files (MonoDevelop/Xamarin Studio)
11 | *.userprefs
12 |
13 | # Build results
14 | [Dd]ebug/
15 | [Dd]ebugPublic/
16 | [Rr]elease/
17 | [Rr]eleases/
18 | x64/
19 | x86/
20 | bld/
21 | [Bb]in/
22 | [Oo]bj/
23 | [Ll]og/
24 |
25 | # Visual Studio 2015 cache/options directory
26 | .vs/
27 | # Uncomment if you have tasks that create the project's static files in wwwroot
28 | #wwwroot/
29 |
30 | # MSTest test Results
31 | [Tt]est[Rr]esult*/
32 | [Bb]uild[Ll]og.*
33 |
34 | # NUNIT
35 | *.VisualState.xml
36 | TestResult.xml
37 |
38 | # Build Results of an ATL Project
39 | [Dd]ebugPS/
40 | [Rr]eleasePS/
41 | dlldata.c
42 |
43 | # DNX
44 | project.lock.json
45 | artifacts/
46 |
47 | *_i.c
48 | *_p.c
49 | *_i.h
50 | *.ilk
51 | *.meta
52 | *.obj
53 | *.pch
54 | *.pdb
55 | *.pgc
56 | *.pgd
57 | *.rsp
58 | *.sbr
59 | *.tlb
60 | *.tli
61 | *.tlh
62 | *.tmp
63 | *.tmp_proj
64 | *.log
65 | *.vspscc
66 | *.vssscc
67 | .builds
68 | *.pidb
69 | *.svclog
70 | *.scc
71 |
72 | # Chutzpah Test files
73 | _Chutzpah*
74 |
75 | # Visual C++ cache files
76 | ipch/
77 | *.aps
78 | *.ncb
79 | *.opendb
80 | *.opensdf
81 | *.sdf
82 | *.cachefile
83 | *.VC.db
84 | *.VC.VC.opendb
85 |
86 | # Visual Studio profiler
87 | *.psess
88 | *.vsp
89 | *.vspx
90 | *.sap
91 |
92 | # TFS 2012 Local Workspace
93 | $tf/
94 |
95 | # Guidance Automation Toolkit
96 | *.gpState
97 |
98 | # ReSharper is a .NET coding add-in
99 | _ReSharper*/
100 | *.[Rr]e[Ss]harper
101 | *.DotSettings.user
102 |
103 | # JustCode is a .NET coding add-in
104 | .JustCode
105 |
106 | # TeamCity is a build add-in
107 | _TeamCity*
108 |
109 | # DotCover is a Code Coverage Tool
110 | *.dotCover
111 |
112 | # NCrunch
113 | _NCrunch_*
114 | .*crunch*.local.xml
115 | nCrunchTemp_*
116 |
117 | # MightyMoose
118 | *.mm.*
119 | AutoTest.Net/
120 |
121 | # Web workbench (sass)
122 | .sass-cache/
123 |
124 | # Installshield output folder
125 | [Ee]xpress/
126 |
127 | # DocProject is a documentation generator add-in
128 | DocProject/buildhelp/
129 | DocProject/Help/*.HxT
130 | DocProject/Help/*.HxC
131 | DocProject/Help/*.hhc
132 | DocProject/Help/*.hhk
133 | DocProject/Help/*.hhp
134 | DocProject/Help/Html2
135 | DocProject/Help/html
136 |
137 | # Click-Once directory
138 | publish/
139 |
140 | # Publish Web Output
141 | *.[Pp]ublish.xml
142 | *.azurePubxml
143 | # TODO: Comment the next line if you want to checkin your web deploy settings
144 | # but database connection strings (with potential passwords) will be unencrypted
145 | *.pubxml
146 | *.publishproj
147 |
148 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
149 | # checkin your Azure Web App publish settings, but sensitive information contained
150 | # in these scripts will be unencrypted
151 | PublishScripts/
152 |
153 | # NuGet Packages
154 | *.nupkg
155 | # The packages folder can be ignored because of Package Restore
156 | **/packages/*
157 | # except build/, which is used as an MSBuild target.
158 | !**/packages/build/
159 | # Uncomment if necessary however generally it will be regenerated when needed
160 | #!**/packages/repositories.config
161 | # NuGet v3's project.json files produces more ignoreable files
162 | *.nuget.props
163 | *.nuget.targets
164 |
165 | # Microsoft Azure Build Output
166 | csx/
167 | *.build.csdef
168 |
169 | # Microsoft Azure Emulator
170 | ecf/
171 | rcf/
172 |
173 | # Windows Store app package directories and files
174 | AppPackages/
175 | BundleArtifacts/
176 | Package.StoreAssociation.xml
177 | _pkginfo.txt
178 |
179 | # Visual Studio cache files
180 | # files ending in .cache can be ignored
181 | *.[Cc]ache
182 | # but keep track of directories ending in .cache
183 | !*.[Cc]ache/
184 |
185 | # Others
186 | ClientBin/
187 | ~$*
188 | *~
189 | *.dbmdl
190 | *.dbproj.schemaview
191 | *.pfx
192 | *.publishsettings
193 | node_modules/
194 | orleans.codegen.cs
195 |
196 | # Since there are multiple workflows, uncomment next line to ignore bower_components
197 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
198 | #bower_components/
199 |
200 | # RIA/Silverlight projects
201 | Generated_Code/
202 |
203 | # Backup & report files from converting an old project file
204 | # to a newer Visual Studio version. Backup files are not needed,
205 | # because we have git ;-)
206 | _UpgradeReport_Files/
207 | Backup*/
208 | UpgradeLog*.XML
209 | UpgradeLog*.htm
210 |
211 | # SQL Server files
212 | *.mdf
213 | *.ldf
214 |
215 | # Business Intelligence projects
216 | *.rdl.data
217 | *.bim.layout
218 | *.bim_*.settings
219 |
220 | # Microsoft Fakes
221 | FakesAssemblies/
222 |
223 | # GhostDoc plugin setting file
224 | *.GhostDoc.xml
225 |
226 | # Node.js Tools for Visual Studio
227 | .ntvs_analysis.dat
228 |
229 | # Visual Studio 6 build log
230 | *.plg
231 |
232 | # Visual Studio 6 workspace options file
233 | *.opt
234 |
235 | # Visual Studio LightSwitch build output
236 | **/*.HTMLClient/GeneratedArtifacts
237 | **/*.DesktopClient/GeneratedArtifacts
238 | **/*.DesktopClient/ModelManifest.xml
239 | **/*.Server/GeneratedArtifacts
240 | **/*.Server/ModelManifest.xml
241 | _Pvt_Extensions
242 |
243 | # Paket dependency manager
244 | .paket/paket.exe
245 | paket-files/
246 |
247 | # FAKE - F# Make
248 | .fake/
249 |
250 | # JetBrains Rider
251 | .idea/
252 | *.sln.iml
253 |
--------------------------------------------------------------------------------
/C#pic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/narekye/Password_Generator/844fc1e6b52b74c5b3f18f02d032de491cf517e8/C#pic.png
--------------------------------------------------------------------------------
/GIF.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/narekye/Password_Generator/844fc1e6b52b74c5b3f18f02d032de491cf517e8/GIF.gif
--------------------------------------------------------------------------------
/Password_Genetator/PasswordGenerator/Password.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.Remoting.Messaging;
3 |
4 | namespace PasswordGenerator
5 | {
6 | ///
7 | /// This class used for generate random passwords.
8 | /// Used all digits, uppercase & downcase letters.
9 | /// Can send any parametr to 'Generate' method which will generate password with sended count length.
10 | ///
11 | public static class Password
12 | {
13 | private static string pass = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
14 | public static string Generate(int length)
15 | {
16 | if (length > pass.Length)
17 | {
18 | throw new ArgumentOutOfRangeException("No much characters");
19 | }
20 | Random Rdpass = new Random();
21 | string password = string.Empty;
22 | for (int i = 0; i < length; i++)
23 | {
24 | password += pass[Rdpass.Next(0, pass.Length)];
25 | }
26 | return password;
27 | }
28 | }
29 | ///
30 | /// This class used for generate random passwords.
31 | /// Used all digits,uppercase and downcase letters with all symbols.
32 | /// With this class you can create the instance of HardPassword and use.
33 | ///
34 | public class HardPassword
35 | {
36 | private string pass = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz~!@#$%^&*()-_=+|}{}:;',./";
37 | public string Generate(int length)
38 | {
39 | if (length>pass.Length)
40 | {
41 | throw new ArgumentOutOfRangeException("No much characters");
42 | }
43 | Random rdpass = new Random();
44 | string password = string.Empty;
45 | for (int i = 0; i < length; i++)
46 | {
47 | password += pass[rdpass.Next(rdpass.Next(i, pass.Length))];
48 | }
49 | return password;
50 | }
51 |
52 | public static string ToUpperPassword(string a)
53 | {
54 | return a.ToUpper();
55 | }
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/Password_Genetator/PasswordGenerator/PasswordGenerator.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {C43D1A20-D98C-419E-9FDD-BD8CC501C591}
8 | Library
9 | Properties
10 | PasswordGenerator
11 | PasswordGenerator
12 | v4.5.2
13 | 512
14 |
15 |
16 | true
17 | full
18 | false
19 | bin\Debug\
20 | DEBUG;TRACE
21 | prompt
22 | 4
23 |
24 |
25 | pdbonly
26 | true
27 | bin\Release\
28 | TRACE
29 | prompt
30 | 4
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
54 |
--------------------------------------------------------------------------------
/Password_Genetator/PasswordGenerator/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // Управление общими сведениями о сборке осуществляется с помощью
6 | // набора атрибутов. Измените значения этих атрибутов, чтобы изменить сведения,
7 | // связанные со сборкой.
8 | [assembly: AssemblyTitle("PasswordGenerator")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("PasswordGenerator")]
13 | [assembly: AssemblyCopyright("Copyright © 2017")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Параметр ComVisible со значением FALSE делает типы в сборке невидимыми
18 | // для COM-компонентов. Если требуется обратиться к типу в этой сборке через
19 | // COM, задайте атрибуту ComVisible значение TRUE для этого типа.
20 | [assembly: ComVisible(false)]
21 |
22 | // Следующий GUID служит для идентификации библиотеки типов, если этот проект будет видимым для COM
23 | [assembly: Guid("c43d1a20-d98c-419e-9fdd-bd8cc501c591")]
24 |
25 | // Сведения о версии сборки состоят из следующих четырех значений:
26 | //
27 | // Основной номер версии
28 | // Дополнительный номер версии
29 | // Номер сборки
30 | // Редакция
31 | //
32 | // Можно задать все значения или принять номера сборки и редакции по умолчанию
33 | // используя "*", как показано ниже:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Password_Genetator/Password_Genetator.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 14
4 | VisualStudioVersion = 14.0.25420.1
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PasswordGenerator", "PasswordGenerator\PasswordGenerator.csproj", "{C43D1A20-D98C-419E-9FDD-BD8CC501C591}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestPasswordGenerator", "TesePasswordGenerator\TestPasswordGenerator.csproj", "{176C41BE-6270-4B17-AAB2-91953921C612}"
9 | EndProject
10 | Global
11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
12 | Debug|Any CPU = Debug|Any CPU
13 | Release|Any CPU = Release|Any CPU
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {C43D1A20-D98C-419E-9FDD-BD8CC501C591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17 | {C43D1A20-D98C-419E-9FDD-BD8CC501C591}.Debug|Any CPU.Build.0 = Debug|Any CPU
18 | {C43D1A20-D98C-419E-9FDD-BD8CC501C591}.Release|Any CPU.ActiveCfg = Release|Any CPU
19 | {C43D1A20-D98C-419E-9FDD-BD8CC501C591}.Release|Any CPU.Build.0 = Release|Any CPU
20 | {176C41BE-6270-4B17-AAB2-91953921C612}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21 | {176C41BE-6270-4B17-AAB2-91953921C612}.Debug|Any CPU.Build.0 = Debug|Any CPU
22 | {176C41BE-6270-4B17-AAB2-91953921C612}.Release|Any CPU.ActiveCfg = Release|Any CPU
23 | {176C41BE-6270-4B17-AAB2-91953921C612}.Release|Any CPU.Build.0 = Release|Any CPU
24 | EndGlobalSection
25 | GlobalSection(SolutionProperties) = preSolution
26 | HideSolutionNode = FALSE
27 | EndGlobalSection
28 | EndGlobal
29 |
--------------------------------------------------------------------------------
/Password_Genetator/TesePasswordGenerator/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Password_Genetator/TesePasswordGenerator/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using PasswordGenerator; // add this 'using' to use class library.
3 |
4 | namespace TestPasswordGenerator
5 | {
6 | class Program
7 | {
8 | static void Main()
9 | {
10 | Console.WriteLine();
11 | //Parameter is lenght of your own password. Example 1.
12 | string mypassword = Password.Generate(45);
13 | Console.WriteLine("\t First password with length 4 | {0}", mypassword);
14 | // Or second one example below. Example 2
15 | Console.WriteLine("\t Second password with length 12 | {0}", Password.Generate(12));
16 | var mypass = new HardPassword();
17 | Console.WriteLine("\t Instance created by non-static class | {0}" ,mypass.Generate(34));
18 | mypass.Generate(12);
19 | // Delay !!
20 | Console.Read();
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Password_Genetator/TesePasswordGenerator/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // Управление общими сведениями о сборке осуществляется с помощью
6 | // набора атрибутов. Измените значения этих атрибутов, чтобы изменить сведения,
7 | // связанные со сборкой.
8 | [assembly: AssemblyTitle("TesePasswordGenerator")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("TesePasswordGenerator")]
13 | [assembly: AssemblyCopyright("Copyright © 2017")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Параметр ComVisible со значением FALSE делает типы в сборке невидимыми
18 | // для COM-компонентов. Если требуется обратиться к типу в этой сборке через
19 | // COM, задайте атрибуту ComVisible значение TRUE для этого типа.
20 | [assembly: ComVisible(false)]
21 |
22 | // Следующий GUID служит для идентификации библиотеки типов, если этот проект будет видимым для COM
23 | [assembly: Guid("176c41be-6270-4b17-aab2-91953921c612")]
24 |
25 | // Сведения о версии сборки состоят из следующих четырех значений:
26 | //
27 | // Основной номер версии
28 | // Дополнительный номер версии
29 | // Номер сборки
30 | // Редакция
31 | //
32 | // Можно задать все значения или принять номера сборки и редакции по умолчанию
33 | // используя "*", как показано ниже:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Password_Genetator/TesePasswordGenerator/TestPasswordGenerator.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {176C41BE-6270-4B17-AAB2-91953921C612}
8 | Exe
9 | Properties
10 | TesePasswordGenerator
11 | TestPasswordGenerator
12 | v4.5.2
13 | 512
14 | true
15 |
16 |
17 | AnyCPU
18 | true
19 | full
20 | false
21 | bin\Debug\
22 | DEBUG;TRACE
23 | prompt
24 | 4
25 |
26 |
27 | AnyCPU
28 | pdbonly
29 | true
30 | bin\Release\
31 | TRACE
32 | prompt
33 | 4
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 | {c43d1a20-d98c-419e-9fdd-bd8cc501c591}
58 | PasswordGenerator
59 |
60 |
61 |
62 |
69 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # C# 6.0 Visual Studio 2015 with .NET Framework 4.6 | SW version 1.0
2 |
3 | # Working with `Password Generator` class library.
4 | ### You do not need to create a instance of `Password` class, because its imposible create instance of static class.
5 | ### Use for generate many random passwords, which can improve you to secure somewhat.
6 | ___
7 | ## How to add the `Password` class library in your project shown below.
8 | 
9 | Created class library with name `PasswordGenerator`(you must add the `using PasswordGenerator;`)which contains one `static class` which contains 1 staic field and 1 static method.
10 | Method has 1 parameter which is the **length** of password.
11 | In snippet shown the `static class` with his members.
12 | ```C#
13 | using System;
14 | namespace PasswordGenerator
15 | {
16 | ///
17 | /// This class library used for generate random passwords.
18 | /// Used all digits, uppercase and downcase letters.
19 | /// Can send any parameter to 'Generate' method, which will generate password with sended count length.
20 | ///
21 | public static class Password
22 | {
23 | private static string pass = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
24 | public static string Generate(int length)
25 | {
26 | Random Rdpass = new Random();
27 | string password = String.Empty;
28 | for (int i = 0; i < length; i++)
29 | {
30 | password += pass[Rdpass.Next(0, pass.Length)];
31 | }
32 | return password;
33 | }
34 | }
35 | }
36 | ```
37 | In the solution have added new project where testing class library. The testing was completed in `Console` application.
38 | ```C#
39 | using System;
40 | using PasswordGenerator; // add this 'using' to use class library.
41 | namespace TestPasswordGenerator
42 | {
43 | class Program
44 | {
45 | static void Main()
46 | {
47 | //Parameter is lenght of your own password. Example 1.
48 | string mypassword = Password.Generate(4);
49 | Console.WriteLine(mypassword);
50 | // Or second one example below. Example 2
51 | Console.WriteLine(Password.Generate(12));
52 | // Delay !!
53 | Console.Read();
54 | }
55 | }
56 | }
57 | ```
58 | ### In this picture shown result of testing in console window.
59 | 
60 | ___
61 | # Whats new in second version | SW version 1.1
62 | Added new `non-static` class named by `HardPassword` with new `non-static` method `Generate`.
63 | ### You can create instance of HardPassword class using default constructor, because user constructors n class haven't added.
64 | There is a snippet of `non-static` class shown below.
65 | ```C#
66 | public class HardPassword
67 | {
68 | private string pass = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz~!@#$%^&*()-_=+|}{}:;',./";
69 | public string Generate(int length)
70 | {
71 | if (length>pass.Length)
72 | {
73 | throw new ArgumentOutOfRangeException("No much characters");
74 | }
75 | Random rdpass = new Random();
76 | string password = string.Empty;
77 | for (int i = 0; i < length; i++)
78 | {
79 | password += pass[rdpass.Next(rdpass.Next(i, pass.Length))];
80 | }
81 | return password;
82 | }
83 | }
84 | ```
85 | Updated too the test project shown by Console Application.
86 | ```C#
87 | static void Main()
88 | {
89 | Console.WriteLine();
90 | //Parameter is lenght of your own password. Example 1.
91 | string mypassword = Password.Generate(45);
92 | Console.WriteLine("\t First password with length 4 | {0}", mypassword);
93 | // Or second one example below. Example 2
94 | Console.WriteLine("\t Second password with length 12 | {0}", Password.Generate(12));
95 | var mypass = new HardPassword();
96 | Console.WriteLine("\t Instance created by non-static class | {0}" ,mypass.Generate(34));
97 | // Delay !!
98 | Console.Read();
99 | }
100 | ```
101 | The result in Console window shown in picture.
102 | 
103 | ## Updates soon.
104 | For more information [contact](https://github.com/narekye).
105 | ___
106 | # Have a fun.
107 |
108 |
109 |
--------------------------------------------------------------------------------
/giphy.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/narekye/Password_Generator/844fc1e6b52b74c5b3f18f02d032de491cf517e8/giphy.gif
--------------------------------------------------------------------------------
/my.JPG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/narekye/Password_Generator/844fc1e6b52b74c5b3f18f02d032de491cf517e8/my.JPG
--------------------------------------------------------------------------------
/passwordsnippet.JPG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/narekye/Password_Generator/844fc1e6b52b74c5b3f18f02d032de491cf517e8/passwordsnippet.JPG
--------------------------------------------------------------------------------