bool isContain = empList.Contains("Hamid", StringComparer.CurrentCultureIgnoreCase);
C# | MVC | DotnetCore | Web API | Blazor | HTML | BootStrap | JavaScript | JQuery | EF | Angular | SQL | Azure
Tuesday, 24 May 2016
Saturday, 21 May 2016
password validation in C#
public bool IsValidPassword(string password)
{
string MatchNumberPattern = "^.*(?=.{8,})(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%^&+=]).*$";
if (!string.IsNullOrEmpty(TextBox2.Text.Trim)) {
if (!Regex.IsMatch(password), MatchNumberPattern)) {
return false;
}
}
}
--------------------
Must be at least 8 characters
-Must contain at least one lower case,oneupper case,
-One digit and one special character
{
string MatchNumberPattern = "^.*(?=.{8,})(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%^&+=]).*$";
if (!string.IsNullOrEmpty(TextBox2.Text.Trim)) {
if (!Regex.IsMatch(password), MatchNumberPattern)) {
return false;
}
}
}
--------------------
Must be at least 8 characters
-Must contain at least one lower case,oneupper case,
-One digit and one special character
Thursday, 5 May 2016
asp.net step by step
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
entity framework step by step
<!-- For more information on Entity Framework configuration, visit-->
http://go.microsoft.com/fwlink/?LinkID=237468
http://go.microsoft.com/fwlink/?LinkID=237468
how to drop constraints in sql server
DECLARE @EmpName NVARCHAR(100)
SELECT @EmpName = default_constraints.name
FROM
sys.all_columns
INNER JOIN
sys.tables
ON all_columns.object_id = tables.object_id
INNER JOIN
sys.schemas
ON tables.schema_id = schemas.schema_id
INNER JOIN
sys.default_constraints
ON all_columns.default_object_id = default_constraints.object_id
WHERE
schemas.name = 'dbo'
AND tables.name = EmpTable
AND all_columns.name = 'EmpGuid'
EXEC ('ALTER TABLE EmpTable DROP CONSTRAINT ' + @EmpName)
Alter Table EmpTable drop column EmpGuid
how to authenticate my webapi
Hi all,
Please go with this url. It is really very helpful.
http://www.codeproject.com/Articles/1005485/RESTful-Day-sharp-Security-in-Web-APIs-Basic
http://www.asp.net/web-api/overview/security
http://www.c-sharpcorner.com/UploadFile/ff2f08/token-based-authentication-using-Asp-Net-web-api-owin-and-i/
Please go with this url. It is really very helpful.
http://www.codeproject.com/Articles/1005485/RESTful-Day-sharp-Security-in-Web-APIs-Basic
http://www.asp.net/web-api/overview/security
http://www.c-sharpcorner.com/UploadFile/ff2f08/token-based-authentication-using-Asp-Net-web-api-owin-and-i/
Wednesday, 4 May 2016
allow number only in angularjs
$scope.allowNumberOnly = function ($event) {
var a = [];
var k = $event.which;
for (var i = 48; i < 58; i++)
a.push(i);
if (k === 46 || k === 8) {
a.push(k);
}
if (!(a.indexOf(k) >= 1))
$event.preventDefault();
};
var a = [];
var k = $event.which;
for (var i = 48; i < 58; i++)
a.push(i);
if (k === 46 || k === 8) {
a.push(k);
}
if (!(a.indexOf(k) >= 1))
$event.preventDefault();
};
latest C# interview question
constant, static and readonly
dispose and finalize methods
ref and out parameters
string and stringbuilder
sealed class
array and arraylist
What is using statement
dispose and finalize methods
ref and out parameters
string and stringbuilder
sealed class
array and arraylist
What is using statement
convert string to date in C#
IFormatProvider culture = new System.Globalization.CultureInfo("en-US", true);
var dateVal = DateTime.Parse(strDate, culture, System.Globalization.DateTimeStyles.AssumeLocal);
var dateVal = DateTime.Parse(strDate, culture, System.Globalization.DateTimeStyles.AssumeLocal);
Subscribe to:
Posts (Atom)