Re: security permissions for creating a file
- From: "Ignacio Machin \( .NET/ C# MVP \)" <ignacio.machin AT dot.state.fl.us>
- Date: Tue, 2 Aug 2005 12:30:16 -0400
hi,
post the text of the exception.
cheers,
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Mark" <Scollop027@xxxxxxx> wrote in message
news:dco6ob$ig6$01$1@xxxxxxxxxxxxxxxxxxxx
> Hi Nicholas,
>
> I tried a console application and as admin I have no restriction in any
> directory.
>
> regards Mark
>
>
>
> "Nicholas Paldino [.NET/C# MVP]" <mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx> schrieb
> im Newsbeitrag news:eszHSt3lFHA.3256@xxxxxxxxxxxxxxxxxxxxxxx
>> Mark,
>>
>> You get this exception because you don't have rights to create or
>> open
>> the file in the directory that it is set in. You need to try and create
> the
>> file in a directory that you have rights to, or, if the file exists,
>> check
>> the rights on the file to make sure that you can open it for writing.
>>
>> Hope this helps.
>>
>>
>> --
>> - Nicholas Paldino [.NET/C# MVP]
>> - mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx
>>
>> "Mark" <Scollop027@xxxxxxx> wrote in message
>> news:dco3i4$btq$01$1@xxxxxxxxxxxxxxxxxxxx
>> > Hello,
>> >
>> > in a simple console application I try to create a file with some code
>> > like:
>> >
>> > FileStream file = new FileStream("test.txt", FileMode.OpenOrCreate,
>> > FileAccess.Write);
>> > StreamWriter sw = new StreamWriter(file);
>> > sw.Write("Hello");
>> > sw.Close();
>> > file.Close();
>> >
>> > I will get an error System.Security.SecurityException
>> >
>> > Are there only one way to avoid this and how this can be done?
>> >
>> > Thanks and regards
>> > Mark
>> >
>> >
>>
>>
>
>
.
- Follow-Ups:
- Re: security permissions for creating a file
- From: Mark
- Re: security permissions for creating a file
- From: Mark
- Re: security permissions for creating a file
- References:
- security permissions for creating a file
- From: Mark
- Re: security permissions for creating a file
- From: Nicholas Paldino [.NET/C# MVP]
- Re: security permissions for creating a file
- From: Mark
- security permissions for creating a file
- Prev by Date: Re: security permissions for creating a file
- Next by Date: Re: security permissions for creating a file
- Previous by thread: Re: security permissions for creating a file
- Next by thread: Re: security permissions for creating a file
- Index(es):
Relevant Pages
|