PackUriHelper.GetRelativeUri(Uri, Uri) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns the relative URI between two specified PackagePart URIs.
public:
static Uri ^ GetRelativeUri(Uri ^ sourcePartUri, Uri ^ targetPartUri);
public static Uri GetRelativeUri (Uri sourcePartUri, Uri targetPartUri);
static member GetRelativeUri : Uri * Uri -> Uri
Public Shared Function GetRelativeUri (sourcePartUri As Uri, targetPartUri As Uri) As Uri
Parameters
- sourcePartUri
- Uri
The URI of the source part.
- targetPartUri
- Uri
The URI of the target part.
Returns
The relative URI from sourcePartUri
to targetPartUri
.
Exceptions
sourcePartUri
or targetPartUri
is null
.
Either the sourcePartUri
or targetPartUri
does not have a valid Uri syntax.
Remarks
The following table illustrates sample cases for GetRelativeUri.
sourcePartUri |
targetPartUri |
Returned relative URI |
---|---|---|
/mydoc/markup/page.xml | /mydoc/markup/picture.jpg | picture.jpg |
/mydoc/markup/page.xml | /mydoc/picture.jpg | ../picture.jpg |
/mydoc/markup/page.xml | /mydoc/images/picture.jpg | ../images/picture.jpg |
Applies to
See also
التعاون معنا على GitHub
يمكن العثور على مصدر هذا المحتوى على GitHub حيث يمكنك أيضاً إضافة مشاكل وطلبات سحب ومراجعتها. للحصول على معلومات إضافية، اطلع على دليل المساهم لدينا.