开发者

about WPF GetResourceStream

开发者 https://www.devze.com 2023-02-03 04:02 出处:网络
StreamResourceInfo streamInfo = Application.GetResourceStream(new uri(\"UIOnly;component/Images/my_work.png\", UriKind.Relative));
StreamResourceInfo streamInfo = Application.GetResourceStream(new uri("UIOnly;component/Images/my_work.png", UriKind.Relative));

if ((streamInfo != null) && (streamInfo.Stream != null))
{
    开发者_JAVA百科  using (var stream = streamInfo.Stream)
      {

      }
}

when above code executed, the UIOnly.dll is locked until application exit, why??


Somehow the file handle is not released.

Have you tried explicit calling Close on the stream instead of just disposing it?

0

精彩评论

暂无评论...
验证码 换一张
取 消