How do you invoke System.IO.File.CreateText such that all users may have
read and write access to this file? I have tried
{
string RemoteConfigFile =
System.IO.Path.GetDirectoryName(Application.ExecutablePath) +
"\\Settings\\Remoting.config";

System.Security.Permissions.FileIOPermission FA = new
System.Security.Permissions.FileIOPermission(System.Security.Permissions.FileIOPermissionAccess.AllAccess,
RemoteConfigFile);

System.IO.StreamWriter Writer = System.IO.File.CreateText(RemoteConfigFile);

}

But it does not work.

I appreciate the help

Re: CreateTextFile with RW access for all users by Mattias

Mattias
Tue Jun 28 05:40:59 CDT 2005

>How do you invoke System.IO.File.CreateText such that all users may have
>read and write access to this file?

Ideally you place it under x:\Documents and Settings\All
Users\Application Data\ which is the location designed to hold files
shared by all users. You can use
Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData)
to get the path.




Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.