Friday, October 9, 2020

Encrypt connection strings

 This guide shows how to encrypt whole connection string in web.config in an IIS website.

https://blog.elmah.io/the-ultimate-guide-to-connection-strings-in-web-config/


In short, run this command inside command prompt as administrator

aspnet_regiis -pef "connectionStrings" "c:\path\to\the\folder\containing\webconfig"

Regex Email validation in c# dot net core

 Use this regex /^_?[a-zA-Z0-9]([a-zA-Z0-9]*[._+-])*[a-zA-Z0-9_]+@(?!-)[A-Za-z0-9-]{1,63}(?<!-)(\.(?!-)[A-Za-z0-9-]{1,63}(?<!-))*\.[A-...