Programming Articles

Page 88 of 2547

Call a method Asynchronously in C#

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

Asynchronous programming in C# is an efficient approach for handling operations that may be blocked or delayed. In synchronous processing, if an operation is blocked, the entire application waits, causing it to become unresponsive and take longer to complete tasks. Using the asynchronous approach, applications can continue executing other tasks while waiting for blocked operations to complete. This is especially important in GUI applications where blocking the main thread causes the interface to freeze. The Problem with Synchronous Code In GUI applications, when synchronous operations take too long, the application shows "not responding" messages because the main ...

Read More

BitConverter.Int64BitsToDouble() Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 138 Views

The BitConverter.Int64BitsToDouble() method in C# is used to reinterpret the specified 64-bit signed integer to a double-precision floating-point number. This method performs a bit-level reinterpretation rather than a numeric conversion, meaning it treats the long integer's binary representation as if it were the binary representation of a double. Syntax Following is the syntax − public static double Int64BitsToDouble(long value); Parameters value − A 64-bit signed integer whose bit pattern will be reinterpreted as a double-precision floating-point number. Return Value This method returns a double-precision floating-point number whose bit representation ...

Read More

What does the interface IStructuralEquatable do in C#?

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

The IStructuralEquatable interface in C# defines methods to support the comparison of objects for structural equality. This means two objects are considered equal if they have the same structure and equal values, rather than being the same reference. This interface is particularly useful for collections like arrays, tuples, and other composite objects where you want to compare the actual content rather than object references. Syntax The interface defines two methods − public interface IStructuralEquatable { bool Equals(object other, IEqualityComparer comparer); int GetHashCode(IEqualityComparer comparer); } Methods ...

Read More

C# program to print unique values from a list

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

In C#, you can extract unique values from a List using the Distinct() LINQ method. This method filters out duplicate elements and returns only the unique values, maintaining the order of their first occurrence. Syntax Following is the syntax for using Distinct() method − List uniqueList = originalList.Distinct().ToList(); The Distinct() method returns an IEnumerable, so we use ToList() to convert it back to a List. Using Distinct() with Integer List Here's how to remove duplicate integers from a list and display only unique values − using System; using System.Collections.Generic; using ...

Read More

C# Console.WindowHeight Property

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

The Console.WindowHeight property in C# gets or sets the height of the console window measured in rows. This property allows you to retrieve the current console window height or modify it programmatically to control the display area of your console application. Syntax Following is the syntax for getting the window height − int height = Console.WindowHeight; Following is the syntax for setting the window height − Console.WindowHeight = newHeight; Return Value The property returns an int value representing the height of the console window in rows. When setting, it ...

Read More

Dynamic Binding in C#

Chandu yadav
Chandu yadav
Updated on 17-Mar-2026 1K+ Views

In Dynamic binding, the compiler defers type checking until runtime instead of compile time. This allows you to work with objects whose types are determined dynamically, providing flexibility when dealing with anonymous types, COM objects, or dynamic languages. The dynamic keyword in C# enables late binding, where method calls, property access, and type conversions are resolved at runtime. This is particularly useful for returning anonymous types from methods, since anonymous type names are only visible to the compiler. Syntax Following is the syntax for declaring a dynamic variable − dynamic variableName = value; ...

Read More

Decimal.ToUInt32() Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 116 Views

The Decimal.ToUInt32() method in C# is used to convert the value of the specified Decimal to the equivalent 32-bit unsigned integer. This method performs truncation, discarding the fractional part and returning only the integer portion. Syntax Following is the syntax − public static uint ToUInt32(decimal val); Parameters val − The decimal number to convert to a 32-bit unsigned integer. Return Value Returns a 32-bit unsigned integer (uint) that represents the truncated value of the specified decimal. The fractional part is discarded. How It Works The method converts a decimal ...

Read More

Char.GetNumericValue() Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 661 Views

The Char.GetNumericValue() method in C# converts a specified Unicode character to its corresponding numeric value as a double. This method is particularly useful when working with Unicode digits from various scripts and numeral systems. Syntax Following is the syntax for the Char.GetNumericValue() method − public static double GetNumericValue(char ch); Parameters ch − A Unicode character to convert to its numeric value. Return Value The method returns a double representing the numeric value of the character. If the character does not represent a numeric digit, it returns -1. ...

Read More

Time Functions in C#

Chandu yadav
Chandu yadav
Updated on 17-Mar-2026 1K+ Views

The DateTime structure in C# provides numerous methods and properties for working with dates and times. These time functions allow you to manipulate DateTime instances by adding or subtracting specific time intervals, extracting time components, and performing various time-related operations. Time functions in C# are essential for applications that need to handle scheduling, logging, time calculations, and date arithmetic operations. Common Time Functions The following table shows the most commonly used time manipulation methods in the DateTime class − Method Description AddDays(Double) Returns a new DateTime that adds the ...

Read More

What is index-based I/O BitArray collection in C#?

Chandu yadav
Chandu yadav
Updated on 17-Mar-2026 233 Views

The BitArray class in C# manages a compact array of bit values represented as Boolean values, where true indicates the bit is on (1) and false indicates the bit is off (0). It is part of the System.Collections namespace and provides an efficient way to store and manipulate bits. BitArray is particularly useful for scenarios requiring bitwise operations, boolean flags, or when memory efficiency is crucial since it stores bits compactly rather than using full bytes for each boolean value. Syntax Following is the syntax for creating a BitArray − BitArray bitArray = new BitArray(size); ...

Read More
Showing 871–880 of 25,467 articles
« Prev 1 86 87 88 89 90 2547 Next »
Advertisements