这是代码片段
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 notrelative”异常抛出
最佳答案
您的问题特定于 WPF。请参阅Application.GetContentStream
方法。
您将了解到此方法需要相对 URI。请参阅“WPF Application, Resource, Content and Data files”。
关于c# - 如何打开 WPF 内容流?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2861976/