Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27569

How to restart a console application completely without leaving it?

$
0
0
Hello, first post here :) I'm new to VB, and I started it for an A-level at my school. I'm learning about IF statements and I'm doing a simple password strength program to find it. The ending of what i have is:


Code:

If TotalStrength = 1 Then

                Console.WriteLine("Your password is WEAK!")

                If Numeric = False Then
                    Console.WriteLine("Your password must contain at least one number!")
                End If
                If UpperCase = False Then
                    Console.WriteLine("Your password must contain at least one upper case character!")
                End If
                If LowerCase = False Then
                    Console.WriteLine("Your password must contain at least one lower case character!")
                End If

            ElseIf TotalStrength = 2 Then

                Console.WriteLine("Your password is MEDIUM!")
                If Numeric = False Then
                    Console.WriteLine("Your password must contain at least one number!")
                End If
                If UpperCase = False Then
                    Console.WriteLine("Your password must contain at least one upper case character!")
                End If
                If LowerCase = False Then
                    Console.WriteLine("Your password must contain at least one lower case character!")
                End If

            ElseIf TotalStrength = 3 Then
                Console.WriteLine("Password is strong.")

            ElseIf TotalStrength = 0 Then
                Console.WriteLine("Error: Strength too low")

            Else
                Console.WriteLine("Error")
            End If

        Else

            'Password Length is not good

            Console.WriteLine("Your password must be between 6 and 12 characters long!")

        End If

    End Sub

End Module

I want to add an Application.Restart if the code isn't strong, which also resets all the variables I used before. However, when I try to add Application.Restart, it doesn't exist. I'm using Visual Studio Express 2012 if that helps. Thanks!

Viewing all articles
Browse latest Browse all 27569

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>