Removed code that is now handled separately by ProcessBuilder

This commit is contained in:
2023-03-29 14:38:29 +02:00
parent 13123b2103
commit dfd8c1d462
2 changed files with 0 additions and 59 deletions

View File

@@ -1,5 +1,3 @@
using System.Text;
using System.Diagnostics;
namespace Password_Generator
{
@@ -34,33 +32,6 @@ namespace Password_Generator
public static string? New(string recipient, int length, bool no_symbols = false)
{
try
{
Process proc = new Process()
{
StartInfo = new ProcessStartInfo
{
FileName = "cmd.exe", //TODO: pipe the return value of RandomStr to gpg with the --quiet --encrypt --recipient {recipient} flags
Arguments = $"echo {RandomStr(length, no_symbols)} | gpg --quiet --encrypt --recipient {recipient}",
UseShellExecute = false,
RedirectStandardOutput = true,
CreateNoWindow = true
}
};
proc.Start();
StringBuilder builder = new StringBuilder();
while (!proc.StandardOutput.EndOfStream)
{
builder.Append(proc.StandardOutput.ReadLine());
}
return builder.ToString();
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
return null;
}
}
}