Skip to content

Commit 63d48ea

Browse files
committed
* Improved password strength indicator
* Updated code documentation
1 parent d07b1ef commit 63d48ea

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

Advanced PassGen/Advanced PassGen.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
</Reference>
5252
<Reference Include="System" />
5353
<Reference Include="System.Drawing" />
54-
<Reference Include="System.Xml" />
5554
<Reference Include="System.Core" />
5655
<Reference Include="System.Xaml">
5756
<RequiredTargetFramework>4.0</RequiredTargetFramework>

Advanced PassGen/Classes/Password.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ namespace Advanced_PassGen.Classes
55
public class Password
66
{
77
#region Variables
8-
98
private string _actualPassword;
10-
119
#endregion
1210

1311
/// <summary>
@@ -30,7 +28,7 @@ public string ActualPassword
3028
public int Length { get; private set; }
3129

3230
/// <summary>
33-
/// The strength of a password, indicated by a number ranging from 0 to 5. The higher the score, the stronger the password.
31+
/// The strength of a password, indicated by a number ranging from 0 to 6. The higher the score, the stronger the password.
3432
/// </summary>
3533
public int Strength { get; private set; }
3634

@@ -50,7 +48,7 @@ private static int CheckStrength(string password)
5048
if (password.Length >= 10) score++;
5149
if (Regex.Match(password, @"\d", RegexOptions.ECMAScript).Success) score++;
5250
if (Regex.Match(password, @"[a-z]", RegexOptions.ECMAScript).Success && Regex.Match(password, @"[A-Z]", RegexOptions.ECMAScript).Success) score++;
53-
if (Regex.Match(password, @"[!,@,#,$,%,^,&,*,?,_,~,-,£,(,)]", RegexOptions.ECMAScript).Success) score++;
51+
if (Regex.Match(password, @"[:,µ,;,<,>,+,!,@,#,$,%,^,&,*,?,_,~,-,£,(,)]", RegexOptions.ECMAScript).Success) score++;
5452

5553
return score;
5654
}

Advanced PassGen/Windows/MainWindow.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@
162162
<DataTemplate>
163163
<!-- ReSharper disable once Xaml.BindingWithContextNotResolved -->
164164
<!-- ReSharper disable once Xaml.BindingWithContextNotResolved -->
165-
<ProgressBar Height="20" Width="100" Maximum="5" Value="{Binding Strength, Mode=OneWay}" />
165+
<ProgressBar Height="20" Width="100" Maximum="6" Value="{Binding Strength, Mode=OneWay}" />
166166
</DataTemplate>
167167
</GridViewColumn.CellTemplate>
168168
</GridViewColumn>
@@ -198,7 +198,7 @@
198198
<RowDefinition></RowDefinition>
199199
<RowDefinition></RowDefinition>
200200
</Grid.RowDefinitions>
201-
<ProgressBar Margin="5" x:Name="PgbStrength" Grid.Row="0" Maximum="5" Height="20"></ProgressBar>
201+
<ProgressBar Margin="5" x:Name="PgbStrength" Grid.Row="0" Maximum="6" Height="20"></ProgressBar>
202202
<Button Margin="5" Grid.Row="1" Content="Advise" Click="BtnAdvise_Click"></Button>
203203
</Grid>
204204
</Grid>

0 commit comments

Comments
 (0)