C# String Format for DateTime Overview

In this tutorial, we are going to use the method String.Format to format string for DateTime DataType. Format a String for DateTime using C# Example: DateTime dateTime = DateTime.Now; String date; date = String.Format("Date & Time Format: {0}", dateTime); Console.WriteLine(date); date = String.Format("Date Only Format: {0:D}", dateTime); Console.WriteLine(date); date = String.Format("Time Only Format: {0:T}", dateTime);... » read more

Convert String to Enum and Enum to string in C#

For example, we have the following enum: enum Days { Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday } Convert enum string Use Enum.ToString method To convert an enumeration value to String. Days days = Days.Monday; string stringEnum = days.ToString(); Console.Write(stringEnum); Convert string to enum string strString = "Monday"; Days days = (Days)Enum.Parse(typeof(Days), strString); Or to... » read more

String.Format in C# for Decimal

In this article, we will learn how to use the String.Format function to format a string into Decimal number format. How to format a Double in C# using String.Format For example, if you have to format a number up to two decimal places, use a pattern that specifies two zeros after point such as 0.00.... » read more

C# FileStream: open, read, write files in C#

In .NET Framework, the System.IO namespace contains classes and functions that are used for file-related functionality, such as creating, reading, writing, updating, or closing a file. In this article, we will look at the FileStream class and its importance in WinForms applications. Using FileStream Class in C# for file operations It is a recommended programming... » read more

Introduction to File attributes in C#

In this article, we will learn about file attributes in C#, how to set or get file attributes, and the FileAttributes Enum. FileAttributes Enum The file Attributes is an Enum that contains attributes fields that can be set or get when dealing with files or directories. Here are the lists of the fields of the FileAttributes... » read more

Integrating React with other JavaScript libraries

Integrating React with other JavaScript libraries The biggest difference between React and JavaScript is the way they interact with the DOM. React has no idea of any changes made to the DOM outside of its scope. If jQuery or another library manipulates the same DOM nodes, React won’t be able to recover from the unknown... » read more

Startup.cs Class in ASP.NET Core explained

Startup.cs file in .NET Core The primary task of the Startup class is configuring the request pipeline, the series of request delegates that get called serially. This way, the class not only serves to be the starting point of the application but also determines the course the application would eventually take. No wonder all of... » read more

How to get time information of a file in C#

In this article, you will learn how to get time-related information of a file. There are two different methods to achieve this. You can either use static methods of File class or call methods of FileIno class after initiating it. Get time information of a file in C# using the File Class Let’s say you... » read more

Catch Unhandled Exceptions in WinForms Apps using C#

In this article, we will learn how to handle an unhandled exception being thrown in C#. An exception is an error that occurs at runtime, and an unhandled exception occurs when the application fails to handle the exception being thrown properly. Unhandled Exceptions in C# Applications The UnhandledException Event notifies an app whenever an unhandled... » read more

Show/Hide Text Box using JavaScript & jQuery

In this article, you will learn how to show/hide a textbox based on the user’s selection of the drop-down menu. If the user selects yes from the drop-down menu, the text box will appear. Show/Hide a TextBox in Javascript and jQuery HTML <form> <div id="drop-down" name="drop-down"> <label for="travel">Have you visited Europe before? </label> <select name="travel"... » read more

How to handle forms in React

How to create and handle forms in React JS frameworks make your life much easier when it comes to forms, as they are provided to you with form validation out of the box. But for some weird reason, React wants us to handle forms ourselves. In this lesson, you are going to learn about React... » read more

C# TextBox Control

In this lesson, you will learn about essential control in the WinForms application world, which is the TextBox Control. Introduction to TextBox Control in C# A TextBox is widely used in Windows Application, mainly to get or set data from/to a data source. Just like other controls, a TextBox has its properties and events. this... » read more

C# Button Control

In this lesson, you will learn about the Button Control from the toolbox and its most used properties and events. Introduction to Button Control in C# In C# WinForms applications, a button is widely used to perform actions, such as save, search, cancel, and more. Literally you cannot see a Window Form that does not... » read more

Work with conditional rendering in React

Conditional rendering in React Let’s create a simple class-based component that has only one state – pet. This component will render a button, which when clicked, changes the state of the pet. If the pet is a cat, it will be changed into the dog, and if it is set to a dog, the state... » read more