Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Server Side Programming Articles
Page 858 of 2109
Type.GetInterface() Method in C#
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 MoreDateTime.CompareTo() Method in C#
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 MoreDateTime.Equals() Method in C#
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 MoreDateTime.FromBinary() Method in C#
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 MoreDateTime.FromFileTime() Method in C#
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 MoreDateTime.FromFileTimeUtc() Method in C#
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 MoreUri.MakeRelativeUri(Uri) Method in C#
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 MoreUri.ToString() Method in C#
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 MoreDouble.ToString Method in C#
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 MoreDecimal.ToString() Method in C#
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