zoukankan      html  css  js  c++  java
  • WPF学习之路(十三)URL

    URL一般由三个部分组成,协议、资源所在主机地址、资源路径

    WPF中URL同样有三部分组成:pack、authority(application:| siteoforigin:)、路径

    资源文件

    本地程序集

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

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

    引用的程序集

    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);

    内容文件

    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);    源站点文件

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

    相对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);

    以上内容转载自 http://zhxh1012.blog.163.com/blog/static/140866457201191752652161/

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

    To be continue...

  • 相关阅读:
    JSTL标签库
    JavaScript中数组操作
    jquery . fancybox()
    jQuery ajax
    jquery学习笔记2
    codeforces_1066_B.Heaters
    codeforces_1065_D.three pieces_思维
    codeforces_B. Forgery
    codeforces_C. Sequence Transformation
    codeforces_D. Social Circles
  • 原文地址:https://www.cnblogs.com/alex09/p/4458956.html
Copyright © 2011-2022 走看看