Topics

Csharp

About this topic: Articles tagged __TAG__

Showing 446 articles

Topics

Articles

Showing 446 articles

How-tos How to Delete All Files in a Directory in C# Use DirectoryInfo.GetFiles() or EnumerateFiles() to remove files in C#. DirectoryInfo.Delete(true) removes the directory it is called on and its contents; to keep a parent … How-tos How to Convert Int to Byte in C# Choose between converting an integer to one byte or serializing it as a byte array in C#. How-tos How to Use a Bitmask in C# In this article, we'll learn how to use bitmask in C#. How-tos How to Disable and Enable Buttons in C# Disable and re-enable buttons in Windows Forms, WPF, and ASP.NET with the correct state property and event-handler patterns. How-tos How to Get File Name From the Path in C# Learn how to use C# path APIs to get a file name from a path, handle platform-specific separators, and distinguish file paths from URLs. How-tos Standard Deviation in C# Calculate population standard deviation in C# with a custom method or an extension method, and handle empty or reusable sequences. How-tos How to Convert Enum to String in C# Convert an enum value to its member name with ToString(), or use DescriptionAttribute and a switch mapping for custom display labels. How-tos How to Do Percentage Calculation in C# Learn how to calculate a percentage of a value, increase a value, and decrease a value in C#. How-tos How to Reset Timer in C# Restart a one-shot System.Timers.Timer in C# with Stop and Start, and learn how AutoReset controls recurring elapsed events. How-tos How to Check Whether a File Exists in C# Learn how to check whether a file exists in C# with File.Exists and how to use the result safely. How-tos How to Convert String Array to Int Array in C# In this guide, we will learn how to convert a string array to an int array in C#. How-tos How to Exit Console Application in C# Choose between returning from Main and terminating a C# console application immediately, with clear exit-code and cleanup behavior. How-tos How to Stop a Thread in C# In this article, I'll explain how to start and stop a thread in C#. How-tos Carriage Return in C# In this article, we'll learn carriage return in a string in C#. How-tos How to Minimize Applications in the System Tray in C# This article explains how to minimize a Windows Forms application to the system tray with NotifyIcon in C#, hiding the form and restoring it from the tray icon. How-tos How to Read a CSV File and Store Its Values Into an Array in C# This how-to article shows different methods to read a CSV file and store its values into an array in C#. It introduces methods like OpenRead(), ReadLine() and TextFieldParser How-tos How to Add a Newline to a String in C# Learn three ways to add a line break to a C# string: use ` `, `Environment.NewLine`, or replace a marker in existing text. How-tos How to Write to an Excel File in C# Learn how to write to an Excel file in C# How-tos How to Initialize a List of Tuples in C# This article explores several approaches to efficiently initialize a list of tuples in C#. How-tos HTML to PDF in C# Convert an HTML string to an A4 PDF in C# with HtmlRenderer.PdfSharp. How-tos How to Check if TextBox Is Empty in C# Check a Windows Forms TextBox with String.IsNullOrEmpty() or TextBox.Text.Length, and learn when whitespace-aware validation is needed. How-tos C# Convert Int to Char This tutorial teaches how to cast int to char in C#. How-tos How to Get Selected Value of a ComboBox in C# Learn how to read the selected item, displayed text, or bound value from a Windows Forms ComboBox in C#. How-tos How to Open a PDF File in C# Learn how to launch a PDF in its default viewer or extract its text with C#, and how to assess WinForms viewer controls.

← All topics