469,609 Members | 1,107 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,609 developers. It's quick & easy.

Isolated Storage

I'm executing an external process from my C# app.

It uses a typical command line type interface:

program.exe inputfile outputfile

I want the outputfile stored in IsolatedStorage.

Is there anyway to do this without re-reading
the file and re-writing it?

I really like the idea of IsolatedStorage for these
files, but if that won't work is it OK to just store
them in a directory next to my executable?

I thought I read somewhere that this could cause
a security exception?

Where else should I be storing user files?

Thanks,

Jon

Jul 9 '06 #1
7 6089
Hello Jon,

JBI'm executing an external process from my C# app.
JBIt uses a typical command line type interface:
JBprogram.exe inputfile outputfile
JBI want the outputfile stored in IsolatedStorage.
JBIs there anyway to do this without re-reading
JBthe file and re-writing it?

Do you mean doesn't put files in storage and keep only references?

JBI really like the idea of IsolatedStorage for these files, but if
JBthat won't work is it OK to just store them in a directory next to
JBmy executable?

and where i'd like to keep them otherwise?

JBI thought I read somewhere that this could cause
JBa security exception?
JBWhere else should I be storing user files?

Which files? Settings or what? You can encrypt/secure them

---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Jul 9 '06 #2
You could try to first create a file in isolated storage, get it's name,
and then use the name to make the external program overwrite the file.

I don't know if it's possible, and it kind of breaks the "Isolated" in
"IsolatedStorage".

If it can't be done that way, you can create a temporary file using the
name from System.IO.Path.GetTempFileName(). That way you won't have it
in your program directory.

Jon Berry wrote:
I'm executing an external process from my C# app.

It uses a typical command line type interface:

program.exe inputfile outputfile

I want the outputfile stored in IsolatedStorage.

Is there anyway to do this without re-reading
the file and re-writing it?

I really like the idea of IsolatedStorage for these
files, but if that won't work is it OK to just store
them in a directory next to my executable?

I thought I read somewhere that this could cause
a security exception?

Where else should I be storing user files?

Thanks,

Jon
Jul 9 '06 #3
I don't thin you can get a full path to a file in isolated storage.

"Göran Andersson" <gu***@guffa.comwrote in message
news:O6**************@TK2MSFTNGP03.phx.gbl...
You could try to first create a file in isolated storage, get it's name,
and then use the name to make the external program overwrite the file.

I don't know if it's possible, and it kind of breaks the "Isolated" in
"IsolatedStorage".

If it can't be done that way, you can create a temporary file using the
name from System.IO.Path.GetTempFileName(). That way you won't have it in
your program directory.

Jon Berry wrote:
>I'm executing an external process from my C# app.

It uses a typical command line type interface:

program.exe inputfile outputfile

I want the outputfile stored in IsolatedStorage.

Is there anyway to do this without re-reading
the file and re-writing it?

I really like the idea of IsolatedStorage for these
files, but if that won't work is it OK to just store
them in a directory next to my executable?

I thought I read somewhere that this could cause
a security exception?

Where else should I be storing user files?

Thanks,

Jon

Jul 9 '06 #4
It may very well be as you think.

The IsolatedStorageFileStream inherits the Name property from the
FileStream class. I don't know if this is the physical path of the file
or just a local name inside the isolated storage.

Steve wrote:
I don't thin you can get a full path to a file in isolated storage.

"Göran Andersson" <gu***@guffa.comwrote in message
news:O6**************@TK2MSFTNGP03.phx.gbl...
>You could try to first create a file in isolated storage, get it's name,
and then use the name to make the external program overwrite the file.

I don't know if it's possible, and it kind of breaks the "Isolated" in
"IsolatedStorage".

If it can't be done that way, you can create a temporary file using the
name from System.IO.Path.GetTempFileName(). That way you won't have it in
your program directory.

Jon Berry wrote:
>>I'm executing an external process from my C# app.

It uses a typical command line type interface:

program.exe inputfile outputfile

I want the outputfile stored in IsolatedStorage.

Is there anyway to do this without re-reading
the file and re-writing it?

I really like the idea of IsolatedStorage for these
files, but if that won't work is it OK to just store
them in a directory next to my executable?

I thought I read somewhere that this could cause
a security exception?

Where else should I be storing user files?

Thanks,

Jon
Jul 9 '06 #5

"Michael Nemtsev" <ne*****@msn.comwrote in message
news:17***************************@msnews.microsof t.com...
JBI want the outputfile stored in IsolatedStorage.
JBIs there anyway to do this without re-reading
JBthe file and re-writing it?

Do you mean doesn't put files in storage and keep only references?
I wanted to put the files in IsolatedStorage.
I was just trying to avoid the extra write to the hard drive.
Thus avoiding the need to delete the temporary files generated by the
external process after they are put in IsolatedStorage.
>
JBI really like the idea of IsolatedStorage for these files, but if
JBthat won't work is it OK to just store them in a directory next to
JBmy executable?

and where i'd like to keep them otherwise?
I just found Application.LocalUserAppDataPath
I guess that's the next best solution.
JBI thought I read somewhere that this could cause
JBa security exception?
JBWhere else should I be storing user files?

Which files? Settings or what? You can encrypt/secure them
No, they are tweaked out media files. They are not really meant to be used
by other programs.
The user should not really need to access the files directly.

The point I was trying to make was that I read somewhere that
non-administrator user
may not be able to write to the "Program Files" directory. True?

Jon

Jul 9 '06 #6

"Göran Andersson" <gu***@guffa.comwrote in message
news:O6**************@TK2MSFTNGP03.phx.gbl...
If it can't be done that way, you can create a temporary file using the
name from System.IO.Path.GetTempFileName(). That way you won't have it in
your program directory.
Thanks, I might just end up using this temp file dealio.

If I do, will I need to programmatically delete the files or is this done
for me?

Jon

Jul 9 '06 #7

"Jon Berry" <no***@jose.blahwrote in message
news:uM**************@TK2MSFTNGP03.phx.gbl...
>
"Göran Andersson" <gu***@guffa.comwrote in message
news:O6**************@TK2MSFTNGP03.phx.gbl...
>If it can't be done that way, you can create a temporary file using the
name from System.IO.Path.GetTempFileName(). That way you won't have it in
your program directory.

Thanks, I might just end up using this temp file dealio.

If I do, will I need to programmatically delete the files or is this done
for me?
No you need to handle this yourself too.
Jul 9 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Jody Gelowitz | last post: by
3 posts views Thread by gani | last post: by
1 post views Thread by malcolm | last post: by
reply views Thread by Namratha Shah \(Nasha\) | last post: by
3 posts views Thread by U.C. | last post: by
reply views Thread by CodeMonkey | last post: by
2 posts views Thread by Andrus | last post: by
reply views Thread by devrayhaan | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.