简体   繁体   English

了解System.Uri

[英]Understanding System.Uri

StreamResourceInfo sri;
sri = App.GetResourceStream(new Uri("WebBrowserIsoStorage;component/Images/textmate.jpg", UriKind.Relative)); 
using (BinaryReader reader = new BinaryReader(sri.Stream)) 
{ 
    using (BinaryWriter writer = new BinaryWriter(imageStream)) 
    { 
        while (sri.Stream.Position < sri.Stream.Length) 
        { 
            writer.Write(reader.ReadByte()); 
        } 
    } 
} 

What does the WebBrowserIsoStorage; WebBrowserIsoStorage;是什么? in the path mean (line 2)? 在路径的意思(第2行)中?

That uri string is a relative Pack UrI (see Table 2 in the linked page for a similar example). 该uri字符串是相对的Pack UrI (有关类似示例,请参见链接页中的表2)。

The first part ( WebBrowserIsoStorage ) is the assembly in which the resource (the textmate.jpg image) lives. 第一部分( WebBrowserIsoStorage )是资源(textmate.jpg图像)所在的程序集。 The second part is the path to the resource within the assembly. 第二部分是程序集中资源的路径。

WebBrowserIsoStorage是Web浏览器的“ 隔离存储”位置。

这意味着系统中存在一个名为WebBrowserIsoStorage ,并且通过在组件后面跟随路径来尝试访问其资源。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM