Posts

Node js app always running on windows server boot

this is stackoverflow link to guide to best way https://stackoverflow.com/questions/20445599/auto-start-node-js-server-on-boot

Call one .ts file function to another .ts file function in angular 4-5-6-7-8

Image
Call one angular .ts file function to another .ts file function in angular 4-5-6-7-8

Server-side Rendering (SSR): An intro to Angular Universal

Enable SSR in Angular 8.0 ng add @nguniversal / express - engine -- clientProject angular . io - example where angular.io-example = your project name. Build SSR angular project using this command npm run build : ssr && npm run serve : ssr Deploy or upload Angular SSR 8.0 project into server  npm run build:ssr Move the  dist  over to your server install  PM2 npm install pm2 -g On your server, use PM2 to run the server bundled app pm2 start dist/server.js If you're using Nginx, or other web servers, make sure to redirect requests to the port that the app started with PM2 is listening on. To stop PM2 use following command. pm2 stop  dist/server.js

Load Document.Ready function on Routing navigation in angular 4-5-6-7-8

write your all document.ready code in one single jquery function and call that function on document.ready. use this function on typescript. import { Component , OnInit } from '@angular/core' ; declare function main_init (): any ; declare function common_init (): any ; @ Component ({ selector: 'app-home' , templateUrl: './home.component.html' , styleUrls: [ './home.component.css' ] }) export class HomeComponent implements OnInit { constructor () { } ngOnInit () { main_init (); common_init (); } }

Window Resize Event Function in Angular 4-5

Window Resize function in angular 4-5 using HostListner import { HostListener} from '@angular/core'     @HostListener('window:resize', ['$event'])     sizeChange(event) {         debugger;         let dd= event.currentTarget.innerHeight;         var hh = (dd) - (250)               $(".ui-datatable-scrollable").css("height",hh);         $(".ui-datatable-scrollable").css("overflow","auto");        console.log('size changed.', event);     }

C# Asp.net The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256.

Add following line in web.config  <appSettings>       <add key="AWS.S3.UseSignatureVersion4" value="true" /> </appSettings> or refer following URL Click here

Upload Excel File Using Angular 2-3-4-5

Component.Html Design : <div class="ui-g-12 ui-md-6 ui-lg-2" [style]="{'display':'block','margin-top':'0px','height':'34px'}">       <div style="border: 1px solid #ebedf0;padding-top: 10px;margin-top: 10px;padding-bottom:  10px;padding-left: 15px;">                <input type="file" style="display: block;" (change)="incomingfile($event)" placeholder="Upload file" accept=".xlsx" style="background-color: #edeff2; width: 95%;">       </div>     </div>      <div class="ui-g-12 ui-md-6 ui-lg-1" [style]="{'display':'block','margin-top':'0px','height':'34px'}">           <button type="button" class="btn btn-info" (click)="Upload()" [disabled]="!this.file" style="margin-top:18px;">Upload...

Get Current Method Name in Catch Block

This Method use to get current controller or action method name in MVC> ActionContext.ActionDescriptor.ActionName

Send Push Notification to ANDROID Devices

SEND PUSH NOTIFICATION TO ANDROID DEVICES public static string APPSendNotification(string Title, string Text, string DeviceID, CSendNoti Data, int DeviceType = 1)     {         var result = "-1";         try         {             if (!string.IsNullOrEmpty(DeviceID))             {                 var webAddr = "https://fcm.googleapis.com/fcm/send";                 //VAISHALI GEMS                 //string SERVER_API_KEY = "SERVERAPIKEY";                 //string SENDER_ID = "SENDERID";                 string SERVER_API_KEY = "SERVERAPIKEY";                 string SENDER_ID = "SENDERID";     ...

Angular 4: Get Distinct Record From Array List Object Typescript

Angular 4: Get Distinct Record From Array List Object Typescript  this._HeadList =this._AllList.filter(             (obj, idx, arr) => (arr.findIndex((o) => o.Supplier_ID === obj.Supplier_ID) === idx)         );

Change row and font color of PrimeNG DataTable Angular 4

Image
Hello Friends Here are sample code of Changing Row and Font Color or PrimeNG datatabale Grid Angular 4

Amazon MWS - Retrieves Amazon product Data from Amazon databases

Retrieves Amazon product data from Amazon databases using C# Client Library.  All information is displayed in the console.  This demo project does not contain access keys to the Amazon seller account. Download Link Get information from Stack Overflow Link

Write Content in file in Amazon S3 Cloud asp.net c#

Use this code to write content in asp.net c# in Amazon S3 Cloud     public void WriteContentInFile()         {             try             {                 AWSCredentials credentials = new BasicAWSCredentials("Accesskey", "secretkey");                 AmazonS3Config config = new AmazonS3Config();                 config.ServiceURL = "s3.amazonaws.com";                 config.RegionEndpoint = Amazon.RegionEndpoint.GetBySystemName("ap-south-1");                 AmazonS3Client client;                 using (client = new AmazonS3Client(credentials, config))                 {         ...

Create New File In Amazon S3 Cloud in asp.net c#

Below code use to create or generate new file .txt in Amazon S3 Cloud in asp.net c#.          public void CreateFileInAmazon()         {             try             {                 AWSCredentials credentials = new BasicAWSCredentials("accesskey", "secretkey");                 AmazonS3Config config = new AmazonS3Config();                 config.ServiceURL = "s3.amazonaws.com";                 config.RegionEndpoint = Amazon.RegionEndpoint.GetBySystemName("ap-south-1");                 AmazonS3Client client;                 using (client = new AmazonS3Client(credentials, config))                 ...

Get Files and Folders From Amazon S3 Cloud in Asp.net C#

Image
How to get or list all files and folders from Amazon S3 Cloud in asp.net c#? Steps Install NuGet "AWSSDK" from Nuget Manage. Put below code in c#             AWSCredentials credentials = new BasicAWSCredentials("Access Key", "Secret Key");             AmazonS3Config config = new AmazonS3Config();             config.ServiceURL = "s3.amazonaws.com";             config.RegionEndpoint = Amazon.RegionEndpoint.GetBySystemName("ap-south-1");             AmazonS3Client client;             string[] folderArry = { "ABC" };             using (client = new AmazonS3Client(credentials, config))             {                 ListObjectsRequest request = new ListObjectsRequest     ...

Convert Html Code to Image JPG PNG in asp.net C#

Hello Friends, Here are code for convert html code to Image JPG PNG in asp.net c# First Install Nuget Package by Following Command. Install-Package HtmlRenderer.WinForms -Version 1.4.13 then Use Following c# code to generate image.             Bitmap m_Bitmap = new Bitmap(400, 600);             PointF point = new PointF(0, 0);             SizeF maxSize = new System.Drawing.SizeF(500, 500);             HtmlRenderer.HtmlRender.Render(Graphics.FromImage(m_Bitmap),                                                     "<html><body><p>This is a whatsappfb html code</p>"                                       ...