Posts

Showing posts from September, 2019

C# - Strong Password Regular Expression

^(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*[~!@ #$%^&*_+=[{\]};:<>|.?,-]).{6,20}$ var hasMatchPasswordRegex = new Regex(service.GetGlobalSetUp().Rows[ 0 ][ "password_regex" ].ToString());             if (!hasMatchPasswordRegex.IsMatch(change_password.NEW_PASSWORD))             {                 response.status = HttpStatusCode.InternalServerError;                 response.statusText = " <strong>Fail</strong>" + service.GetGlobalSetUp().Rows[ 0 ][ "password_mis_match_message" ].ToString();                 var resultOutput = JsonConvert.SerializeObject(response, Formatting.Indented,                       new JsonSerializerSettings                       {   ...

Backup and Restore a PostgreSQL Database

Backup : Backup database in .sql file and with role from dropdown Restore : C:\Program Files\PostgreSQL\ 9.4 \bin>psql -U postgres db_cpm <C:\CPM\cpm.sql