gpt4 book ai didi

c# - 如何打开 WPF 内容流?

转载 作者:行者123 更新时间:2023-11-30 22:45:54 25 4
gpt4 key购买 nike

这是代码片段

String str= ??????? // I want to assign c:/my/test.html to this string
Uri uri= new Uri (str);
Stream src = Application.GetContentStream(uri).Stream;

正确的做法是什么?我收到“URI 不是相对的”异常抛出

最佳答案

您的问题特定于 WPF。查看Application.GetContentStream方法。

您会读到此方法需要一个相对 URI。参见“WPF Application, Resource, Content and Data files”。

关于c# - 如何打开 WPF 内容流?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2861976/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com