static void Main(string[] args)
{
using(ResXResourceWriter resWriter=new ResXResourceWriter(@"F:\xxxx\xxx\MyResource.resx"))
{
byte[] secBytes = File.ReadAllBytes(@"F:\xxx\MyResources\rhlsl.xxx");
resWriter.AddResource("rhsl", secBytes);
resWriter.Generate();
}
Console.Write("xxx");
}
然后再打开MyResource.resx
:
那么,现在可以直接用Resources.rhsl
来得到byte[],
从而
MemoryStream stream = new MemoryStream(Resources.rhsl);
StreamReader sr = new StreamReader(stream, Encoding.UTF8);
string result= sr.ReadToEnd();
就可以得到result。
标签:Resx,stream,xxx,resx,resWriter,rhsl,new,WPF,Byte From: https://www.cnblogs.com/johnyang/p/18466411