'Automatically coming slashes with FileStream in Monodroid
I have been working on a project using Monodroid. I need to use FileStream to access a file in my project. I write the path as a first argument in FileStream like FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read) but two slashes come automatically from FileStream, therefore the path is not valid. For example, if the path is "res/raw/aFile.txt", after FileStream method it becomes "//res/raw/aFile.txt" and an exception occurs. Because of the exception, I cannot split and get the valid path. How can I get rid of the two slashes that automatically coming from the FileStream method?
Regards.
Solution 1:[1]
If you're trying to open a raw resource file, I would suggest using the OpenRawResource() method instead:
using (var stream = Resources.OpenRawResource(Resource.Raw.File))
{
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Greg Shackles |
