I have a .dat file which I was given to use for a test application. I would like to distribute this file with my library. How can I do this without needing to tell them copy this here to this folder etc.
I added a file named File1.dat to my resources within my library. Now what I need to do is pass to a method the path to the file (File1.dat) so that it can read from it. How can I accomplish this.
One more post as a solution doesn't hurt and neither does a break a little time to think.
My previous post where I asked for a path was a knee jerk reaction because obviously there is no path once it is managed by resource manager.
What I ended up doing was reading the dat file back out into a byte[] which is what it was stored as anyways within ResourceManager. I then just used a memorystream in place of a filestream as needed via overloaded methods.
Marked as answer by skin256 on Jan 28, 2011 02:44 AM
skin256
Member
275 Points
110 Posts
Distribute .dat file with library
Jan 27, 2011 05:39 PM|LINK
I have a .dat file which I was given to use for a test application. I would like to distribute this file with my library. How can I do this without needing to tell them copy this here to this folder etc.
Thanks in advance.
skin256
Member
275 Points
110 Posts
Re: Distribute .dat file with library
Jan 27, 2011 06:20 PM|LINK
I believe this page helped solve my question.
http://msdn.microsoft.com/en-us/library/7k989cfy%28v=vs.80%29.aspx
Thanks.
skin256
Member
275 Points
110 Posts
Re: Distribute .dat file with library
Jan 28, 2011 12:52 AM|LINK
Ok I lied.
I added a file named File1.dat to my resources within my library. Now what I need to do is pass to a method the path to the file (File1.dat) so that it can read from it. How can I accomplish this.
skin256
Member
275 Points
110 Posts
Re: Distribute .dat file with library
Jan 28, 2011 02:33 AM|LINK
One more post as a solution doesn't hurt and neither does a break a little time to think.
My previous post where I asked for a path was a knee jerk reaction because obviously there is no path once it is managed by resource manager.
What I ended up doing was reading the dat file back out into a byte[] which is what it was stored as anyways within ResourceManager. I then just used a memorystream in place of a filestream as needed via overloaded methods.