Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,938 questions

51,875 answers

573 users

How to get all methods of Uri Class in C#

1 Answer

0 votes
using System;
using System.Linq;
 
class Program
{
    static void ShowMethods(Type type) {
        foreach (var method in type.GetMethods()) {
            var parameterDescriptions = string.Join
                             (", ", method.GetParameters()
                             .Select(x => x.ParameterType + " " + x.Name)
                             .ToArray());
 
            Console.WriteLine("{0} {1}({2})",
                              method.ReturnType,
                              method.Name,
                              parameterDescriptions);
        }
    }
 
    static void Main() {
        ShowMethods(typeof(Uri));
    }
}
 
 
 
 
/*
run:

System.String get_AbsolutePath()
System.String get_AbsoluteUri()
System.String get_LocalPath()
System.String get_Authority()
System.UriHostNameType get_HostNameType()
System.Boolean get_IsDefaultPort()
System.Boolean get_IsFile()
System.Boolean get_IsLoopback()
System.String get_PathAndQuery()
System.String[] get_Segments()
System.Boolean get_IsUnc()
System.String get_Host()
System.Int32 get_Port()
System.String get_Query()
System.String get_Fragment()
System.String get_Scheme()
System.String get_OriginalString()
System.String get_DnsSafeHost()
System.String get_IdnHost()
System.Boolean get_IsAbsoluteUri()
System.Boolean get_UserEscaped()
System.String get_UserInfo()
System.UriHostNameType CheckHostName(System.String name)
System.String GetLeftPart(System.UriPartial part)
System.String HexEscape(System.Char character)
System.Char HexUnescape(System.String pattern, System.Int32& index)
System.Boolean IsHexEncoding(System.String pattern, System.Int32 index)
System.Boolean CheckSchemeName(System.String schemeName)
System.Boolean IsHexDigit(System.Char character)
System.Int32 FromHex(System.Char digit)
System.Int32 GetHashCode()
System.String ToString()
System.Boolean op_Equality(System.Uri uri1, System.Uri uri2)
System.Boolean op_Inequality(System.Uri uri1, System.Uri uri2)
System.Boolean Equals(System.Object comparand)
System.Uri MakeRelativeUri(System.Uri uri)
System.String MakeRelative(System.Uri toUri)
System.Boolean TryCreate(System.String uriString, System.UriKind uriKind, System.Uri& result)
System.Boolean TryCreate(System.Uri baseUri, System.String relativeUri, System.Uri& result)
System.Boolean TryCreate(System.Uri baseUri, System.Uri relativeUri, System.Uri& result)
System.String GetComponents(System.UriComponents components, System.UriFormat format)
System.Int32 Compare(System.Uri uri1, System.Uri uri2, System.UriComponents partsToCompare, System.UriFormat compareFormat, System.StringComparison comparisonType)
System.Boolean IsWellFormedOriginalString()
System.Boolean IsWellFormedUriString(System.String uriString, System.UriKind uriKind)
System.String UnescapeDataString(System.String stringToUnescape)
System.String EscapeUriString(System.String stringToEscape)
System.String EscapeDataString(System.String stringToEscape)
System.Boolean IsBaseOf(System.Uri uri)
System.Type GetType()

*/

 



answered Oct 13, 2023 by avibootz

Related questions

1 answer 96 views
1 answer 136 views
136 views asked Oct 14, 2023 by avibootz
1 answer 96 views
1 answer 89 views
1 answer 91 views
1 answer 109 views
109 views asked Sep 21, 2023 by avibootz
1 answer 105 views
...