How to Read an embedded resource as array of bytes without writing it to disk?

后端 未结 4 1097
天命终不由人
天命终不由人 2020-12-02 01:38

In my application I compile another program from source.cs file using CodeDom.Compiler and I embed some resources ( exe and dll files ) at compile time using :



        
4条回答
  •  遥遥无期
    2020-12-02 02:20

    File.WriteAllBytes(@"C:\Users\admin\Desktop\MyFile.exe", Resources.BinFile); // binary file
    File.WriteAllText(@"C:\Users\admin\Desktop\text.txt", Resources.TextFile); // text file
    

提交回复
热议问题