How to use gitlab or any git provider with visual studio

Hello, To use gitlab or whatever git provider follow theses steps Make your project as git repository by executing the command git init Move to Team Explorer tab and click on changes   Add your commit message and then commit changes. Select Remote Repository Copy the HTTPS url of your repository from git provider like gitlab Add the […]

Dynamic Validator

Hello Again, In this tutorial I am using dependency injection to add rules for any class and use these rules later in validation process. using System; using System.Collections.Generic; using System.Text.RegularExpressions; namespace DynamicValidator { class Program { static void Main(string[] args) { Emp e1 = new Emp(); e1.id = 123; bool vv = e1.validate(); Console.WriteLine(“Validate: ” + vv.ToString()); e1.name […]

Dynamic Workflow

I tried to implement Dynamic Workflow and how we can create dynamic workflow functions and execute it in sequence, I used Inversion of control to achieve this . here is the idea code: using System; using System.Collections.Generic; namespace a1 { class Program { static void Main(string[] args) { WorkFlow wf = new WorkFlow(); wf._worklist.AddLast(new CreateEmpList()); wf._worklist.AddLast(new CreateEmpList()); wf._worklist.AddLast(new […]

Schedule Email Through ASP.NET or Schedule Tasks Using ASP.NET

// Inside Global.ascx void Application_Start(object sender, EventArgs e) { // Code that runs on application startup System.Timers.Timer myTimer = new System.Timers.Timer(); // Set the Interval to 5 seconds (5000 milliseconds). myTimer.Interval = 5000; myTimer.AutoReset = true; myTimer.Elapsed += new ElapsedEventHandler(myTimer_Elapsed); myTimer.Enabled = true; } public void myTimer_Elapsed(object source, System.Timers.ElapsedEventArgs e) { // use your mailer code clsScheduleMail objScheduleMail […]

FCM (Firebase Cloud Messaging) Push Notification with Asp.Net

public class Notification { private string serverKey = “kkkkk”; private string senderId = “iiddddd”; private string webAddr = “https://fcm.googleapis.com/fcm/send”; public string SendNotification(string DeviceToken, string title ,string msg ) { var result = “-1”; var httpWebRequest = (HttpWebRequest)WebRequest.Create(webAddr); httpWebRequest.ContentType = “application/json”; httpWebRequest.Headers.Add(string.Format(“Authorization: key={0}”, serverKey)); httpWebRequest.Headers.Add(string.Format(“Sender: id={0}”, senderId)); httpWebRequest.Method = “POST”; var payload = new { to = DeviceToken, priority […]

1 3 4 5