Articles on Trending Technologies

Technical articles with clear explanations and examples

What are multicasting delegates in C#?

Samual Sam
Samual Sam
Updated on 17-Mar-2026 2K+ Views

A multicasting delegate in C# is a delegate that holds references to multiple methods. When invoked, it calls all the methods in its invocation list sequentially. This is achieved using the += operator to add methods and -= operator to remove methods from the delegate. Multicasting delegates are particularly useful for implementing event-like behavior where multiple handlers need to be executed when a single event occurs. Syntax Following is the syntax for declaring a multicasting delegate − delegate returnType DelegateName(parameters); Adding and removing methods from a multicasting delegate − DelegateName del ...

Read More

What is the difference between an interface and an abstract class in C#?

Samual Sam
Samual Sam
Updated on 17-Mar-2026 685 Views

In C#, both interfaces and abstract classes provide a way to define contracts that derived classes must follow. However, they serve different purposes and have distinct characteristics that make them suitable for different scenarios. An interface defines a contract specifying what methods, properties, and events a class must implement, but provides no implementation itself. An abstract class can provide both abstract members (without implementation) and concrete members (with full implementation). Interface Syntax Following is the syntax for declaring an interface − public interface IInterfaceName { void MethodName(); string PropertyName ...

Read More

Get the creation time of a file in C#

karthikeya Boyini
karthikeya Boyini
Updated on 17-Mar-2026 2K+ Views

To get the creation time of a file in C#, you can use the CreationTime property of the FileInfo class or the static methods from the File class. This allows you to retrieve when a file was originally created on the file system. Syntax Using the FileInfo class − FileInfo fileInfo = new FileInfo("filename.txt"); DateTime creationTime = fileInfo.CreationTime; Using the static File class − DateTime creationTime = File.GetCreationTime("filename.txt"); Using FileInfo Class The FileInfo class provides an object-oriented approach to work with file information. Create a FileInfo object and access ...

Read More

C# Program to Convert Decimal to Binary

karthikeya Boyini
karthikeya Boyini
Updated on 17-Mar-2026 1K+ Views

Converting a decimal number to binary involves repeatedly dividing the decimal number by 2 and collecting the remainders. In C#, this can be accomplished using manual division or built-in methods like Convert.ToString(). The manual approach uses the division by 2 method where we divide the decimal number by 2, store the remainder, and continue until the quotient becomes 0. The binary representation is formed by reading the remainders in reverse order. Using Manual Division Method This method involves dividing the decimal number by 2 repeatedly and collecting remainders − Decimal to Binary ...

Read More

What are extender provider components in C#?

George John
George John
Updated on 17-Mar-2026 255 Views

An extender provider in C# is a component that can extend other controls by providing additional properties to them at design time. The most common example is the ToolTip component, which adds tooltip functionality to other controls on a form. When you add a ToolTip component to a form, it automatically provides a new property (like "ToolTip on toolTip1") to every other control on the form. This allows you to set tooltip text for each control without directly modifying the control itself. How Extender Providers Work Extender providers implement the IExtenderProvider interface and use special naming conventions ...

Read More

Lowercase suffixes in C#

Samual Sam
Samual Sam
Updated on 17-Mar-2026 194 Views

In C#, lowercase suffixes are used with numeric literals to specify their data type explicitly. These suffixes tell the compiler to treat the literal as a specific numeric type rather than inferring the type automatically. Syntax Following are the common lowercase suffixes used with numeric literals − long number = 12345l; // l for long float number = 3.14f; // f for float uint number = 100u; // u for unsigned int ulong number = 500ul; ...

Read More

Represent Int64 as a Octal string in C#

Arjun Thakur
Arjun Thakur
Updated on 17-Mar-2026 319 Views

To represent Int64 as an octal string in C#, use the Convert.ToString() method and set the base as the second parameter to 8 for octal conversion. Int64 represents a 64-bit signed integer that can store values from -9, 223, 372, 036, 854, 775, 808 to 9, 223, 372, 036, 854, 775, 807. Syntax Following is the syntax for converting Int64 to octal string − Convert.ToString(longValue, 8) Parameters longValue − The Int64 value to convert 8 − The base for octal number system Return Value Returns a string representation ...

Read More

Convert.FromBase64String(String) Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 3K+ Views

The Convert.FromBase64String(String) method in C# converts the specified string, which encodes binary data as base-64 digits, to an equivalent 8-bit unsigned integer array. This method is commonly used for decoding base64-encoded data back to its original byte representation. Syntax Following is the syntax − public static byte[] FromBase64String (string str); Parameters str − The string to convert. It must be a valid base64-encoded string. Return Value Returns a byte[] array containing the decoded binary data from the base64 string. Using FromBase64String for Byte Array Conversion The most common use ...

Read More

Boolean.Equals(Boolean) Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 514 Views

The Boolean.Equals(Boolean) method in C# returns a value indicating whether this instance is equal to a specified Boolean object. This method compares the current Boolean instance with another Boolean value and returns true if they are equal, otherwise false. Syntax Following is the syntax − public bool Equals(bool obj); Parameters obj − A Boolean value to compare to this instance. Return Value This method returns true if obj has the same value as this instance; otherwise, false. Example Let us see an example to implement the Boolean.Equals(Boolean) ...

Read More

C# Program to Convert Fahrenheit to Celsius

Samual Sam
Samual Sam
Updated on 17-Mar-2026 3K+ Views

Temperature conversion between Fahrenheit and Celsius is a common programming task. In C#, you can easily convert Fahrenheit to Celsius using a simple mathematical formula and display the results with proper formatting. The conversion formula subtracts 32 from the Fahrenheit temperature, then multiplies by 5/9 to get the equivalent Celsius temperature. Formula The mathematical formula for converting Fahrenheit to Celsius is − celsius = (fahrenheit - 32) * 5 / 9 Fahrenheit to Celsius Conversion 97°F - 32 × 5/9 ...

Read More
Showing 11001–11010 of 61,297 articles
Advertisements