Open associated application with filestream

J

J

Hi,

I know that to launch an application that is associated with a particular
file I can use Process.Start(filename), but that assumes the file physically
exists somewhere. My problem is I already have the contents of the file in
memory (read from a DB) and it seems a bit redundant to write the data to a
temp file just so Process.Start can re-read the info back into memory and
launch.

Any suggestions or ideas on work arounds would be appreciated!

Thanks,
James
 
D

David Browne

J said:
Hi,

I know that to launch an application that is associated with a particular
file I can use Process.Start(filename), but that assumes the file
physically
exists somewhere. My problem is I already have the contents of the file
in
memory (read from a DB) and it seems a bit redundant to write the data to
a
temp file just so Process.Start can re-read the info back into memory and
launch.

Process.Start is not going to read the file into memory. It's just going to
pass the filename to the target application. It's up to the target
application what to do then. For instance the target application could
write to the file, or delete it, or ignore it.

And assuming that the file is read into memory, it's done in a seperate
process with a seperate address space. So you really need to write it to a
file.

If the file is large, you needn't load it into memory in the first place.
Just write it to a temp file as you read it from the DB.

David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top