Try the example(s) indicated here:

http://msdn.microsoft.com/en-us/library/system.io.file.setaccesscontrol.aspx
http://msdn.microsoft.com/en-us/library/system.security.accesscontrol.filesystemaccessrule.aspx


Regards,


Benj



On Jul 22, 10:03 pm, Arnaud Mongrain <[email protected]> wrote:
> Hello,
>
> I've got a problem at work.  In a program, I'm trying to create an xml file
> so it would always log automatically using the first user credentials that
> connected.  To be sure every user of the terminal will be able to use it, I
> created the file in "All Users/(Application Name)/login.xml".
>
> I'm using DirectoryInfo.CreateSubdirectory(string) to create my subfolder
> (Application Name) if it doesn't exist.  That part works on my work PC, but
> doesn't on the terminal.  And since du Application Name folder doesn't exist
> on the terminal, program won't run cause it can't create the file in the
> folder, since it doesn't exist...
>
> I'm currently log as an administrator on that terminal, so I don't
> understand why it wouldn't work.
>
> Any ideas?
>
> if 
> (!Directory.Exists(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData)
> + \\Application Name <file://application%20name/>))
>
> {
>
> DirectoryInfo dir = new DirectoryInfo(Environment.GetFolderPath(Environment.
> SpecialFolder.CommonApplicationData));
>
> dir.CreateSubdirectory("Application Name");
>
>
>
>
>
>
>
> }

-- 
You received this message because you are subscribed to the Google
Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML
Web Services,.NET Remoting" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/dotnetdevelopment?hl=en?hl=en
or visit the group website at http://megasolutions.net

Reply via email to