How to create file with FILE_ATTRIBUTE_TEMPORARY file in C #?

How to create file with FILE_ATTRIBUTE_TEMPORARY file in C #? (So, to store data in Frame, but to be able to use it as a regular file)

+6
c # file
source share
2 answers

I believe that you will have to use P / Invoke to call native CreateFile , and then use the FileStream constructor (SafeFileHandle, FileAccess) on the FileStream . MSDN has a sample for how to use SafeFileHandle and CreateFile together.

+6
source share

Memory mapped files are an alternative and are built into C # 4.0:

http://msdn.microsoft.com/en-us/library/system.io.memorymappedfiles.memorymappedfile.aspx

+4
source share

All Articles