Skip to content

Commit

Permalink
Move password generation code into its own function
Browse files Browse the repository at this point in the history
  • Loading branch information
Stan Behrens committed Oct 23, 2014
1 parent e72ab03 commit 1926e44
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions Windows/RDP OTP Server/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,11 @@ static void SetPass(string oldpass, string newpass)
File.WriteAllText(@"oldPass.txt", newpass);
}

static int Main(string[] args)
static string NewPass(string oldpass)
{
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;

var newpass = @"";

{
oldpass = File.ReadAllText(@"oldPass.txt");

{
var passchars = @"abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ123456789";
var rand = new Random();
Expand All @@ -38,9 +34,18 @@ static int Main(string[] args)
}

SetPass(oldpass, newpass);
Program.newpass = newpass;
}

return newpass;
}

static int Main(string[] args)
{
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;

oldpass = File.ReadAllText(@"oldPass.txt");
newpass = NewPass(oldpass);

WebRequest request;

{
Expand Down

0 comments on commit 1926e44

Please sign in to comment.