Skip to main content

Posts

Encrypting Passwords in c# appSettings

https://weblogs.asp.net/jongalloway/encrypting-passwords-in-a-net-app-config-file This page uses: System.Runtime.InteropServices.Marshal.SecureStringToBSTR System.Runtime.InteropServices.Marshal.PtrToStringBSTR System.Runtime.InteropServices.Marshal.ZeroFreeBSTR System.Security.Cryptography.ProtectedData.Unprotect System.Security.Cryptography.ProtectedData.Protect System.Security.Cryptography.DataProtectionScope.CurrentUser

C# appSettings

You can access key value pairs within appSettings with AppSettingsReader An example is available at  https://docs.microsoft.com/en-us/dotnet/api/system.configuration.appsettingsreader?view=netframework-4.7.1

C# Drive Info

foreach (DriveInfo DI in DriveInfo.GetDrives()) Console.WriteLine( ( DI.IsReady ? (DI.VolumeLabel.Length == 0 ? "Drive Type: " + DI.DriveType.ToString() : "Volume Label: " + DI.VolumeLabel) : "Not Ready : " + DI.DriveType.ToString() ) + // " (" + DI.Name.Replace("\\", "") + ")" " (" + DI.Name + ")" + Environment.NewLine ); Code highlighting compliments of http://markup.su/highlighter/ Another options is  http://hilite.me/