简体   繁体   中英

Open FileStream with path of memoryStream as FilePath

I have a question,a complicated one!!!

I have some external class library that needs path of file. my application load the file to the memory stream.

I want to give it some path (to the external dll) that will redirect it to the memory stream in order to get the file, instead of to the file system. (the dll working with FileStream).

for example: If I have file (in fileSystem) with name : C:\\MyFile.txt I want to load the file to the memoryStream and provide the external dll somepath, something like "MyMemoryStreamPath" and it will load the file from the memory and not from the file system (it will "Think" that it's file system path, but actually its a path of memmoryStream). just to remind you, the dll working with FileStream. I know that it's a complicated question any idea will be accepted. :)

There's no way to do that. If you have permission issues, you can save your stream to an IsolatedStorage . It has plenty of options and you can get path of the saved file through relfection.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM