Saturday, 24 August 2013

Visual C# Can't create directory, security error

Visual C# Can't create directory, security error

I see myself forced to ask once again, I'm avoiding external help as much
as possible, want to do as much on my own, but my knowledge is still very
limited. My problem is as follows. I have this code:
public string path = Application.StartupPath + @"\maquinas\";
Directory.CreateDirectory(path + Form1.cmaq + @"\" + textinCliente);
Form1.cmaq just has a name such as a,b,c, whatever!
However, I get the following exception once I the
Directory.CreateDirectory code runs. http://i.imgur.com/II1Tqqd.png It
seems to be related with folder permissions.
How can I fix that programatically? So that no action has to be taken by
the user to set the folder permissions.
Thank you in advance!
P.S. since that is in portuguese, in the first line, after
System.NotSupportedException it reads "The format of the specified path is
not supported" That could also be the issue but I can't see what's wrong
with the format of the path really -.-
Also "em" means at / in

No comments:

Post a Comment