从资源读取一个文件,并将其写入到磁盘中的C#磁盘、文件、资源、并将其

2023-09-03 01:44:49 作者:好歌不怕旧

我有一些文件,这些文件中嵌入的资源。我怎样才能节省磁盘这些文件通过C#?

I have some files, which are embedded in a resource. How can I save these files on disk via C#?

推荐答案

使用流:GetManifestResourceStream给你一个流中的资源文件,使用的StreamWriter,你可以写流的内容到磁盘

using streams: GetManifestResourceStream gives you a stream to the file in the resource and using a StreamWriter you can write the contents of that stream to disk.

 
精彩推荐
图片推荐