Posts

Human Captcha (Not Robot) React Component with .Net Core WebApi Backend

Image
A captcha is a challenge response test to determine whether or not the user is human. We may create a React human captcha component with a .Net Core Web API back-end.  Back-end Our back-end is ASP.Net Core Web API 3.1. Back-end will generate a truly random alpha-numeric captcha value, creates a binary image using System.Drawing namespace. Back-end will verify the user input value against the generated value and  return an authentication Token to be used in Forms. The method that generates a random captcha value and creates a binary image is as follows:         /// <summary>         /// generate captcha image         /// </summary>         /// <param name="size">alphanumeric length of the captcha</param>         /// <returns>image properties and image binary data</returns>         private async Task<CaptchaImage> generateCaptcha(int size)         {             try             {                 int width = size * 30;                 int

Custom ActionResult for Files in ASP.NET MVC - ExcelResult

An action result is the standard result from an action.  Action results handle the execution of the result requested by an action method.  Although standard action results FileContentResult and FileStreamResult may be used for downloading files that are generated on the fly, creating a custom action result might be the best solution. For situations that are not supported by  standard action results, we may create custom action results. For example w e may create custom  action result for creating PDF, Excel or Word files on the fly for download or generating and returning images.  Creating a new custom action result requires that our class inherit the abstract class  System.Web.Mvc. ActionResult and override the  ExecuteResult method. As an example let's create a custom action result for exporting data to Excel files on the fly for download. We are using FastMember package for creating DataTable from IEnumerable object and ClosedXML package for creating Excel file from t

ASP.NET MVC Filter Based Authorization

We may use action filters for authorization in an ASP.NET MVC application. An action filter is an attribute that we can apply to a controller action or an entire controller. The ASP.NET MVC framework includes several action filters including OutputCache, HandleError, and Authorize. Authorize action filter enables us to restrict access to a particular user or role. Authorization filters implements the IAuthorizationFilter attribute. Authorization filters are used to implement authentication and authorization for controller actions. The ASP.NET MVC framework includes a base ActionFilterAttribute class. This class implements both the IActionFilter and IResultFilter interfaces and inherits from the Filter class. The base ActionFilterAttribute class has the following methods that to override: OnActionExecuting – called before a controller action is executed. OnActionExecuted – called after a controller action is executed. OnResultExecuting – called before a controller action resul

Platform independent simple password manager application (Electron & NodeJS)

Electron is a framework for creating native applications with web technologies including JavaScript, HTML, and CSS. Electron enables create desktop applications with pure JavaScript by providing a runtime with rich native (operating system) APIs. It allows for the development of desktop GUI applications using Node.js runtime for the backend and Chromium for the frontend component. As a sample platform independent desktop application, I created the JPwdManager, a simple platform independent password manager application. An Electron application is essentially a Node.js application. The starting point is a package.json that is identical to that of a Node.js module. The script specified by the main field is the startup script of your app, which will run the main process. Our package.json file is as follows: {   "name": "jpwdmanager",   "version": "1.0.1",   "description": "platform independent simple password manager app"

Filtering html select listbox items

The efficient way of filtering select list box items may be achieved using JQuery $(function(){     $('#filterInput').keyup(function () {         doFilter(this);     }); }); /* filter method */ function doFilter(item) {     $(item).val($(item).val().toUpperCase());     var valFilter = $(item).val();     var valFilter2 = null;     if ($(item).val().length > 2)         valFilter2 = $(item).val();     $('#listItems>option').each(function () {         var text = $(this).text();         (text.indexOf(valFilter) == 0 || (valFilter2 != null && text.includes(valFilter2) == true)) ? $(this).show() : $(this).hide();     }); }

SharePoint 2013 Cumulative Update'lerin Doğru Şekilde Kurulumu

Microsoft, düzenli olarak SharePoint yazılım güncelleştirmelerini, düzeltme eklerini / hata düzeltmelerini Cumulative Update (Toplu Güncelleştirme) (CU) paketleri olarak yayımlamaktadır. Toplu Güncelleştirmeler, SharePoint 2013 için sayısız düzeltme ve iyileştirmeler içermektedir. Toplu güncelleştirme paketi çok dilli olup tüm diller için güncelleştirmeler içerir.     SharePoint Cumulative Update'lerinin kurulumu, doğrudan uygulanırsa çok uzun zamanınızı alacaktır. SharePoint Cumulative Update'ini yüklemek için en iyi uygulama, update'i yüklemeden önce bazı hizmetlerin devre dışı bırakılmasını ve durdurulmasını gerektirir. Cumulative Update yüklemek için doğru yol aşağıda verilmiştir:     1.  SharePoint  Central Administration Site içerisinde  "Search Service Application" (Application Management > Manage Service Applications) açın. Tüm search crawl'ları (planlananlar dahil) durdurun.     2. Farm'daki tüm makinalarda SharePoint  Management Shell&#

Proper Way of Installing SharePoint Cumulative Updates

Microsoft periodically releases SharePoint software updates, patches / bug fixes as Cumulative Update (CU) packages. Cumulative Updates contain numerous hot fixes and improvements for SharePoint 2013. The cumulative update package is multilingual and contains updates for all languages. Installing SharePoint Cumulative Update process may take too long if it is directly applied. Best practice for installing SharePoint Cumulative Update requires disabling and stopping some services before applying the CU. Proper way of applying cumulative update is given below: 1. Open the "Search Service Application" on SharePoint  Central Administration Site (Application Management > Manage Service Applications). Stop all running or planned Search Crawls. 2. Open SharePoint  Management Shell with administrator privileges on all servers in the Server Farm.  3. Stop the Search  Service Application $ssa = Get-SPEnterpriseSearchServiceApplication $ssa.pause() 4. Disable and Stop the Sh