T
thephatp
I'm trying to do something extremely basic, and I don't remember
having these problems in XP.
I'm running a service, logged in as an administrator. I created a
directory in windows explorer (as administrator), and set all
permissions/security for all users (including the Everyone group) to
full control.
The following code still does not work:
FileStream fs;
try
{
System.Windows.Forms.MessageBox.Show( this.sFileStoreLocation + "\\" +
sFilename + ".txt" );
fs = File.Create( this.sFileStoreLocation + "\\" +
sFilename + ".txt" );
}
catch( Exception e )
{
System.Windows.Forms.MessageBox.Show( e.ToString() );
fs = null;
}
Any ideas? Is this a Vista thing? I don't understand why it is so
difficult to do this right now (and I'm really suspecting Vista).
The scenario I need to work is this:
Any user logs in. My app starts running. The user does something and
my app will need to produce some logging. I check to see a directory
exists in my apps "Program Files" location. If not, the user needs to
be able to create it. All users will need to be able to write to this
directory. (I can't get directory creation to work either, but one
thing at a time--and I assume the solution will fix both problems.)
It will be a general logging location. The creation of the directory
is still important, because if it happends to get deleted, I want to
try to recreate it, not just be sunk for logging. And since I
wouldn't doubt one my clients could accidentally delete this folder, I
have to make it work in code.
Thanks,
Chad
having these problems in XP.
I'm running a service, logged in as an administrator. I created a
directory in windows explorer (as administrator), and set all
permissions/security for all users (including the Everyone group) to
full control.
The following code still does not work:
FileStream fs;
try
{
System.Windows.Forms.MessageBox.Show( this.sFileStoreLocation + "\\" +
sFilename + ".txt" );
fs = File.Create( this.sFileStoreLocation + "\\" +
sFilename + ".txt" );
}
catch( Exception e )
{
System.Windows.Forms.MessageBox.Show( e.ToString() );
fs = null;
}
Any ideas? Is this a Vista thing? I don't understand why it is so
difficult to do this right now (and I'm really suspecting Vista).
The scenario I need to work is this:
Any user logs in. My app starts running. The user does something and
my app will need to produce some logging. I check to see a directory
exists in my apps "Program Files" location. If not, the user needs to
be able to create it. All users will need to be able to write to this
directory. (I can't get directory creation to work either, but one
thing at a time--and I assume the solution will fix both problems.)
It will be a general logging location. The creation of the directory
is still important, because if it happends to get deleted, I want to
try to recreate it, not just be sunk for logging. And since I
wouldn't doubt one my clients could accidentally delete this folder, I
have to make it work in code.
Thanks,
Chad