2

How can i include an external file in a XBAP application? For example a .dat file where i need to extract some data from? I want everything to happen inside the .xbap file, is that possible?

catalin ilie
  • 121
  • 2
  • 7

2 Answers2

1
byte[] ba = Properties.Resources.yourfilename;
//set  Build Action to Resource and Rebuild 
using (var compressedStream = new MemoryStream(ba))
using (var zipStream = new GZipStream(compressedStream, CompressionMode.Decompress))
using (var resultStream = new MemoryStream())
{
    zipStream.CopyTo(resultStream);
    ba1 = resultStream.ToArray();
}
Petroff
  • 21
  • 2
0

You can add the .dat as a resource to the project then during runtime extract using a stream and save to a file on temp folder

Tony
  • 16,527
  • 15
  • 80
  • 134