This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static AppUserManager Create(AppUserManager manager, IdentityFactoryOptions<AppUserManager> options, IOwinContext context) | |
{ | |
// Configure validation logic for usernames | |
manager.UserValidator = new UserValidator<AppUser, int>(manager) | |
{ | |
AllowOnlyAlphanumericUserNames = false, | |
RequireUniqueEmail = true | |
}; | |
// Configure validation logic for passwords |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var assembly = Assembly.GetExecutingAssembly(); | |
var resourceName = "AssemblyName.MyFile.txt"; | |
using (Stream stream = assembly.GetManifestResourceStream(resourceName)) | |
{ | |
using (StreamReader reader = new StreamReader(stream)) | |
{ | |
string result = reader.ReadToEnd(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace Tree | |
{ | |
class Program | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Hashing | |
{ | |
private readonly int SALT_SIZE = 16; | |
private readonly int HASH_SIZE = 32; | |
private byte[] salt; | |
private byte[] newSalt; | |
public string HashWithSalt(string passwordPlainText, string Username) | |
{ | |
byte[] key; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Process currentProcess = Process.GetCurrentProcess(); | |
Process[] processes = Process.GetProcessesByName(currentProcess.ProcessName); | |
if (processes.Count() > 1) | |
{ | |
for (int i = processes.Count() -1; i > 0; i--) | |
{ | |
processes[i].Kill(); | |
} | |
} |
NewerOlder