TargetPartUri() public static method

public static TargetPartUri ( Uri targetPartUri ) : void
targetPartUri System.Uri
return void
示例#1
0
        public static Uri GetRelativeUri(Uri sourcePartUri, Uri targetPartUri)
        {
            Check.SourcePartUri(sourcePartUri);
            Check.TargetPartUri(targetPartUri);

            Uri uri = new Uri("http://fake.com");
            Uri a   = new Uri(uri, sourcePartUri.OriginalString);
            Uri b   = new Uri(uri, targetPartUri.OriginalString);

            return(a.MakeRelativeUri(b));
        }