Server Side Programming Articles

Page 858 of 2109

Type.GetInterface() Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 290 Views

The Type.GetInterface() method in C# is used to get a specific interface implemented or inherited by the current Type. This method searches through all interfaces implemented by a type and returns the one that matches the specified name. Syntax Following are the overloads of the GetInterface() method − public Type GetInterface(string name); public abstract Type GetInterface(string name, bool ignoreCase); Parameters name − The name of the interface to find. ignoreCase − A Boolean value indicating whether to perform a case-insensitive search for the interface name. Return ...

Read More

DateTime.CompareTo() Method in C#

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

The DateTime.CompareTo() method in C# is used to compare the value of this instance to a specified DateTime value. It returns an integer indicating the chronological relationship between two DateTime objects. Syntax Following is the syntax − public int CompareTo(DateTime value); Parameters value − The DateTime object to compare with the current instance. Return Value It returns an integer value − < 0 − If this instance is earlier than the specified value 0 − If this instance is the same as the specified value > 0 − If ...

Read More

DateTime.Equals() Method in C#

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

The DateTime.Equals() method in C# is used to check whether two DateTime objects or instances are equal or not. It returns true if both are equal, otherwise false. This method performs a tick-by-tick comparison, meaning it compares the exact moment in time down to the smallest unit (100-nanosecond intervals). Two DateTime objects are considered equal only if they represent the exact same point in time. Syntax Following is the syntax for the static DateTime.Equals() method − public static bool Equals(DateTime date1, DateTime date2); Parameters date1 − The first DateTime object ...

Read More

DateTime.FromBinary() Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 306 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 202 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 249 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 260 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 311 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
Showing 8571–8580 of 21,090 articles
« Prev 1 856 857 858 859 860 2109 Next »
Advertisements