Csharp Articles

Page 183 of 196

DateTime.FromBinary() Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 305 Views

The DateTime.FromBinary() method in C# is used to deserialize a 64-bit binary value and recreate an original serialized DateTime object. This method is particularly useful when you need to restore a DateTime object that was previously converted to its binary representation using ToBinary(). Syntax Following is the syntax − public static DateTime FromBinary(long dateData); Parameters dateData: A 64-bit signed integer that encodes the Kind property in a 2-bit field and the Ticks property in a 62-bit field. Return Value This method returns a DateTime object that is equivalent to the DateTime ...

Read More

DateTime.FromFileTime() Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 200 Views

The DateTime.FromFileTime() method in C# converts a Windows file time to an equivalent local time. Windows file time represents the number of 100-nanosecond intervals that have elapsed since 12:00 midnight, January 1, 1601 A.D. (UTC). Syntax Following is the syntax − public static DateTime FromFileTime(long fileTime); Parameters The method takes one parameter − fileTime − A Windows file time expressed in ticks (100-nanosecond intervals since January 1, 1601 UTC). Return Value Returns a DateTime object that represents the local time equivalent of the Windows file time ...

Read More

DateTime.FromFileTimeUtc() Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 236 Views

The DateTime.FromFileTimeUtc() method in C# converts a Windows file time to an equivalent UTC DateTime. This method is useful when working with file timestamps or system-level operations that use Windows file time format, which represents time as the number of 100-nanosecond intervals since January 1, 1601 UTC. Syntax Following is the syntax − public static DateTime FromFileTimeUtc(long fileTime); Parameters The method accepts the following parameter − fileTime − A Windows file time expressed in ticks (100-nanosecond intervals since January 1, 1601 UTC). Return Value Returns a DateTime object ...

Read More

Uri.MakeRelativeUri(Uri) Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 248 Views

The Uri.MakeRelativeUri(Uri) method in C# is used to determine the relative difference between two Uri instances. It returns a relative URI that, when resolved against the base URI, yields the target URI. Syntax Following is the syntax − public Uri MakeRelativeUri(Uri uri); Parameters uri − The URI to compare to the current URI instance. This represents the target URI for which you want to create a relative path. Return Value Returns a Uri object that represents the relative URI from the current instance to the specified URI. ...

Read More

Uri.ToString() Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 306 Views

The Uri.ToString() method in C# is used to get a canonical string representation for the specified Uri instance. This method returns the complete URI as a formatted string, including all components such as scheme, host, path, query, and fragment. Syntax Following is the syntax − public override string ToString(); Return Value This method returns a string that contains the unescaped canonical representation of the Uri instance. All characters are unescaped except #, ?, and %. Using Uri.ToString() Method Basic Example Let us see how to use the Uri.ToString() method to ...

Read More

Double.ToString Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 258 Views

The Double.ToString() method in C# is used to convert the numeric value of this instance to its equivalent string representation. This method provides several overloads to format the double value in different ways, including culture-specific formatting and custom format strings. Syntax Following is the syntax for the basic ToString() method − public override string ToString(); Following is the syntax for ToString() with format specifier − public string ToString(string format); Following is the syntax for ToString() with culture-specific formatting − public string ToString(IFormatProvider provider); Return Value ...

Read More

Decimal.ToString() Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 308 Views

The Decimal.ToString() method in C# is used to convert the numeric value of a decimal instance to its equivalent string representation. This method provides various overloads to format the decimal value according to specific requirements. Syntax Following is the basic syntax for Decimal.ToString() method − public override string ToString(); The method also has overloaded versions for custom formatting − public string ToString(string format); public string ToString(IFormatProvider provider); public string ToString(string format, IFormatProvider provider); Parameters format − A standard or custom numeric format string (optional). provider − An object ...

Read More

Math Class Fields with Examples in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 214 Views

The Math class in C# provides essential mathematical constants through predefined fields. The two most commonly used fields are Math.E (Euler's number) and Math.PI (pi), which represent fundamental mathematical constants used in various calculations. These fields are declared as public const double, making them accessible throughout your application without needing to instantiate the Math class. Math.E Field The Math.E field represents Euler's number, which is the natural logarithmic base. This constant is approximately equal to 2.718281828 and is frequently used in exponential and logarithmic calculations. Syntax public const double E = 2.71828182845905; ...

Read More

UInt32.GetTypeCode() Method in C# with Examples

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 164 Views

The UInt32.GetTypeCode() method in C# returns the TypeCode enumeration value for the UInt32 data type. This method is inherited from the IConvertible interface and is used to identify the underlying type of a value at runtime. The TypeCode enumeration provides a way to categorize the fundamental data types in .NET, making it useful for type checking and conversion operations. Syntax Following is the syntax for the UInt32.GetTypeCode() method − public TypeCode GetTypeCode(); Return Value This method returns TypeCode.UInt32, which represents the enumerated constant for the 32-bit unsigned integer type. Using GetTypeCode() ...

Read More

UInt32.ToString() Method in C# with Examples

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

The UInt32.ToString() method in C# is used to convert the numeric value of a UInt32 instance to its equivalent string representation. This method is particularly useful when you need to display unsigned 32-bit integer values as text or concatenate them with strings. The UInt32 type represents unsigned 32-bit integers with values ranging from 0 to 4, 294, 967, 295. The ToString() method provides several overloads to format the output according to different requirements. Syntax Following are the main syntax variations of the UInt32.ToString() method − public override string ToString(); public string ToString(string format); public string ...

Read More
Showing 1821–1830 of 1,951 articles
« Prev 1 181 182 183 184 185 196 Next »
Advertisements