Yes:
static class Extensions
{
public static SecureString DecryptString(this string source)
{
if (source == null)
return null;
SecureString result = new SecureString();
try
{
var decrypted = ProtectedData.Unprotect(Convert.FromBase64String(source), entropy...
Well I can tell you that I'm doing it wrong here:
namespace DecryptStrg
{
class Program
{
static void Main(string[] args)
{
FileInfo file = new FileInfo("C:\\path\to\\password\\file\\here\\textfile.txt");
if (!file.Exists)
{...
I need to declare a secure string a variable that is located in a text file. In Powershell this is easy:
$password = Get-content "C:\text_file_with_secure_string_in_it.txt" | convertto-securestring
How would I declare this variable correctly in C#?
Sorry about that - here it is:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VMware.Vim;
namespace vmwaretest
{
class Program
{
static void Main(string[] args)
{
VimClient c = new...
I found a simple test template on the web to get started learning C# / .NET but I have run in to a few errors when I try to execute the program.
"An unhandled exception of type 'System.UriFormatException' occurred in System.dll
Additional information: Invalid URI: The format of the URI could...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.