I am recovering a Word type File from the database and I give it a path of my C drive and it saves it in my Temp folder, but I do not want to save said file, I just want to open it, I am reading a bit and I think I should generate a temporary for example at this address and then delete the temporary.
C:\Users\elsusuario\AppData\Local\Temp
but how do I create the temporary from C# and that it can be opened from temporary?
If the Word file is in the database and you get the bytes of that file you can do this:
and ready.
if you want to delete the temporary file to save space you can delete it with:
but you would have to make sure that the file is not being used.
if you want to delete it as soon as the user stops using it, then you have to wait for the user to finish the process, you can use this.
proceso.WaitForExit();
It waits for the process to finish, but as far as I remember it accepts a parameter in milliseconds at most to close.