Skip to content
This repository has been archived by the owner on May 3, 2019. It is now read-only.

Commit

Permalink
#14 fixing some things for the password
Browse files Browse the repository at this point in the history
  • Loading branch information
maratbakirov committed Mar 11, 2019
1 parent b8b0c0c commit da009fe
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 2 deletions.
24 changes: 24 additions & 0 deletions SPMeta2.NintexExt.CSOM.O365.Test/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,29 @@ static void Main(string[] args)
}

}

private static SecureString GetConsoleSecurePassword()
{
SecureString pwd = new SecureString();
while (true)
{
ConsoleKeyInfo i = Console.ReadKey(true);
if (i.Key == ConsoleKey.Enter)
{
break;
}
else if (i.Key == ConsoleKey.Backspace)
{
pwd.RemoveAt(pwd.Length - 1);
Console.Write("\b \b");
}
else
{
pwd.AppendChar(i.KeyChar);
Console.Write("*");
}
}
return pwd;
}
}
}
3 changes: 2 additions & 1 deletion SPMeta2.NintexExt.CSOM.SP13.Test/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Program
[STAThread]
static void Main(string[] args)
{
using (ClientContext context = DH.NintexFormsSupport.Provisioning.Helpers.GetClientContext())
using (ClientContext context = Support.Helpers.GetClientContext())
{
context.Load(context.Web);
context.ExecuteQuery();
Expand All @@ -32,5 +32,6 @@ static void Main(string[] args)
//service.PreDeploymentServices.Add(new DefaultRequiredPropertiesValidationService());
}
}

}
}
28 changes: 27 additions & 1 deletion SPMeta2.NintexExt.CSOM.SP13.Test/Utils/Helpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
using System.Text.RegularExpressions;
using System.Threading;

namespace DH.NintexFormsSupport.Provisioning
namespace Support
{

public class OutputMessage : IDisposable
Expand Down Expand Up @@ -216,5 +216,31 @@ public static string CombineUrl(params string[] args)
return SPMeta2.Utils.UrlUtility.CombineUrl(args);
}

private static SecureString GetConsoleSecurePassword()
{
SecureString pwd = new SecureString();
while (true)
{
ConsoleKeyInfo i = Console.ReadKey(true);
if (i.Key == ConsoleKey.Enter)
{
break;
}
else if (i.Key == ConsoleKey.Backspace)
{
pwd.RemoveAt(pwd.Length - 1);
Console.Write("\b \b");
}
else
{
pwd.AppendChar(i.KeyChar);
Console.Write("*");
}
}
return pwd;
}



}
}

0 comments on commit da009fe

Please sign in to comment.