WPF learning path (13) URL, wpf learning path url

Source: Internet
Author: User

WPF learning path (13) URL, wpf learning path url

 

A URL consists of three parts: Protocol, host address of the resource, and resource path.

 

In WPF, URLs are also composed of three parts: pack, authority (application: | siteoforigin :), and Path

 

Resource file

Local Assembly

Uri uri = new Uri ("pack: // application:,/ResourceFile. xaml", UriKind. Absolute );

Uri uri = new Uri ("pack: // application:,/Subfolder/ResourceFile. xaml", UriKind. Absolute );

Referenced assembly

Uri uri = new Uri ("pack: // application:,/ReferencedAssembly; component/ResourceFile. xaml", UriKind. Absolute );

Uri uri = new Uri ("pack: // application:,/ReferencedAssembly; component/Subfolder/ResourceFile. xaml", UriKind. Absolute );

Uri uri = new Uri ("pack: // application:,/ReferencedAssembly; v1.0.0.0; component/ResourceFile. xaml", UriKind. Absolute );

 

Content File

Uri uri = new Uri ("pack: // application:,/ContentFile. xaml", UriKind. Absolute );

Uri uri = new Uri ("pack: // application:,/Subfolder/ContentFile. xaml", UriKind. Absolute );

Uri uri = new Uri ("pack: // siteoforigin:,/SOOFile. xaml", UriKind. Absolute); source site file

Uri uri = new Uri ("pack: // siteoforigin:,/Subfolder/SOOFile. xaml", UriKind. Absolute );

 

Relative URL

Uri uri = new Uri ("/ResourceFile. xaml", UriKind. Relative );

Uri uri = new Uri ("/Subfolder/ResourceFile. xaml", UriKind. Relative );

Uri uri = new Uri ("/ReferencedAssembly; component/ResourceFile. xaml", UriKind. Relative );

Uri uri = new Uri ("/ReferencedAssembly; component/Subfolder/ResourceFile. xaml", UriKind. Relative );

Uri uri = new Uri ("/ContentFile. xaml", UriKind. Relative );

Uri uri = new Uri ("/Subfolder/ContentFile. xaml", UriKind. Relative );

 

 

The above content is reproduced from the http://zhxh1012.blog.163.com/blog/static/140866457201191752652161/

MSDN https://msdn.microsoft.com/zh-cn/library/aa970069 (v = vs.110). aspx

 

 

To be continue...

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.