|
security
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
File Permission System.UnauthorizedAccessExceptionI am trying to modify a file on my computer but I get an error which says the following. "System.UnauthorizedAccessException: Access to the path. I also tried FileIOPermission FileIOPermission fio = new FileIOPermission(FileIOPermissionAccess.AllAccess, paramMP3.fileComplete); FileStream oFileStream; oFileStream = new FileStream(paramMP3.fileComplete , FileMode.Open, FileAccess.ReadWrite); that didn't seem to have any effect on it also. Appreciate any help Thanks Tom Hello Tom,
UnauthorizedException has nothing to do with CAS and FileIOPermission. This is a OS level error - i would say you don't have the necessary NTFS ACLs... --------------------------------------- Dominick Baier - DevelopMentor http://www.leastprivilege.com Show quoteHide quote > Hi friends > > I am trying to modify a file on my computer but I get an error which > says the following. "System.UnauthorizedAccessException: Access to the > path. > > I also tried FileIOPermission > > FileIOPermission fio = new > FileIOPermission(FileIOPermissionAccess.AllAccess, > paramMP3.fileComplete); > FileStream oFileStream; > > oFileStream = new FileStream(paramMP3.fileComplete , FileMode.Open, > FileAccess.ReadWrite); > > that didn't seem to have any effect on it also. > > Appreciate any help > > Thanks > > Tom > Yes that is my initial thought...
however I have cheched the application is using administrator as its identity. The effective permission for administrator is full access. I also checked Everyone user and it also has full access under effective permission. I'm really not sure what else could be wrong. Appreciate your help ! Tom Show quoteHide quote "Dominick Baier [DevelopMentor]" <dbaier@pleasepleasenospamdevelop.com> wrote in message news:852930632616225320420418@news.microsoft.com... > Hello Tom, > > UnauthorizedException has nothing to do with CAS and FileIOPermission. > This is a OS level error - i would say you don't have the necessary NTFS > ACLs... > > --------------------------------------- > Dominick Baier - DevelopMentor > http://www.leastprivilege.com > >> Hi friends >> >> I am trying to modify a file on my computer but I get an error which >> says the following. "System.UnauthorizedAccessException: Access to the >> path. >> >> I also tried FileIOPermission >> >> FileIOPermission fio = new >> FileIOPermission(FileIOPermissionAccess.AllAccess, >> paramMP3.fileComplete); >> FileStream oFileStream; >> >> oFileStream = new FileStream(paramMP3.fileComplete , FileMode.Open, >> FileAccess.ReadWrite); >> >> that didn't seem to have any effect on it also. >> >> Appreciate any help >> >> Thanks >> >> Tom >> > > > Hello Tom,
what happens if you use a different file? maybe someone has a lock on that file, try to pass in the 4th parameter the FileStream ctor - lockMode or similar and set it to none - just to see what happens... --------------------------------------- Dominick Baier - DevelopMentor http://www.leastprivilege.com Show quoteHide quote > Yes that is my initial thought... > > however I have cheched the application is using administrator as its > identity. The effective permission for administrator is full access. I > also checked Everyone user and it also has full access under effective > permission. > > I'm really not sure what else could be wrong. > > Appreciate your help ! > Tom > "Dominick Baier [DevelopMentor]" > <dbaier@pleasepleasenospamdevelop.com> wrote in message > news:852930632616225320420418@news.microsoft.com... > >> Hello Tom, >> >> UnauthorizedException has nothing to do with CAS and >> FileIOPermission. This is a OS level error - i would say you don't >> have the necessary NTFS ACLs... >> >> --------------------------------------- >> Dominick Baier - DevelopMentor >> http://www.leastprivilege.com >>> Hi friends >>> >>> I am trying to modify a file on my computer but I get an error which >>> says the following. "System.UnauthorizedAccessException: Access to >>> the path. >>> >>> I also tried FileIOPermission >>> >>> FileIOPermission fio = new >>> FileIOPermission(FileIOPermissionAccess.AllAccess, >>> paramMP3.fileComplete); >>> FileStream oFileStream; >>> oFileStream = new FileStream(paramMP3.fileComplete , FileMode.Open, >>> FileAccess.ReadWrite); >>> >>> that didn't seem to have any effect on it also. >>> >>> Appreciate any help >>> >>> Thanks >>> >>> Tom >>> thanks for your help
but the file was readonly Show quoteHide quote "Dominick Baier [DevelopMentor]" <dbaier@pleasepleasenospamdevelop.com> wrote in message news:862088632617070425393864@news.microsoft.com... > Hello Tom, > > what happens if you use a different file? maybe someone has a lock on that > file, try to pass in the 4th parameter the FileStream ctor - lockMode or > similar and set it to none - just to see what happens... > > --------------------------------------- > Dominick Baier - DevelopMentor > http://www.leastprivilege.com > >> Yes that is my initial thought... >> >> however I have cheched the application is using administrator as its >> identity. The effective permission for administrator is full access. I >> also checked Everyone user and it also has full access under effective >> permission. >> >> I'm really not sure what else could be wrong. >> >> Appreciate your help ! >> Tom >> "Dominick Baier [DevelopMentor]" >> <dbaier@pleasepleasenospamdevelop.com> wrote in message >> news:852930632616225320420418@news.microsoft.com... >> >>> Hello Tom, >>> >>> UnauthorizedException has nothing to do with CAS and >>> FileIOPermission. This is a OS level error - i would say you don't >>> have the necessary NTFS ACLs... >>> >>> --------------------------------------- >>> Dominick Baier - DevelopMentor >>> http://www.leastprivilege.com >>>> Hi friends >>>> >>>> I am trying to modify a file on my computer but I get an error which >>>> says the following. "System.UnauthorizedAccessException: Access to >>>> the path. >>>> >>>> I also tried FileIOPermission >>>> >>>> FileIOPermission fio = new >>>> FileIOPermission(FileIOPermissionAccess.AllAccess, >>>> paramMP3.fileComplete); >>>> FileStream oFileStream; >>>> oFileStream = new FileStream(paramMP3.fileComplete , FileMode.Open, >>>> FileAccess.ReadWrite); >>>> >>>> that didn't seem to have any effect on it also. >>>> >>>> Appreciate any help >>>> >>>> Thanks >>>> >>>> Tom >>>> > > > Might the file be marked as read-only?
Show quoteHide quote "Tom" <tomgaom***@optusnet.com.au> wrote in message news:431ef2b6$0$1909$afc38c87@news.optusnet.com.au... > Yes that is my initial thought... > > however I have cheched the application is using administrator as its > identity. The effective permission for administrator is full access. I > also checked Everyone user and it also has full access under effective > permission. > > I'm really not sure what else could be wrong. > > Appreciate your help ! > Tom > > "Dominick Baier [DevelopMentor]" <dbaier@pleasepleasenospamdevelop.com> > wrote in message news:852930632616225320420418@news.microsoft.com... >> Hello Tom, >> >> UnauthorizedException has nothing to do with CAS and FileIOPermission. >> This is a OS level error - i would say you don't have the necessary NTFS >> ACLs... >> >> --------------------------------------- >> Dominick Baier - DevelopMentor >> http://www.leastprivilege.com >> >>> Hi friends >>> >>> I am trying to modify a file on my computer but I get an error which >>> says the following. "System.UnauthorizedAccessException: Access to the >>> path. >>> >>> I also tried FileIOPermission >>> >>> FileIOPermission fio = new >>> FileIOPermission(FileIOPermissionAccess.AllAccess, >>> paramMP3.fileComplete); >>> FileStream oFileStream; >>> >>> oFileStream = new FileStream(paramMP3.fileComplete , FileMode.Open, >>> FileAccess.ReadWrite); >>> >>> that didn't seem to have any effect on it also. >>> >>> Appreciate any help >>> >>> Thanks >>> >>> Tom >>> >> >> >> > > you're absolutely right it was readonly... *sigh* I spent too much time
worrying other things instead of checking it Show quoteHide quote "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> wrote in message news:u0OVio7sFHA.524@TK2MSFTNGP12.phx.gbl... > Might the file be marked as read-only? > > > "Tom" <tomgaom***@optusnet.com.au> wrote in message > news:431ef2b6$0$1909$afc38c87@news.optusnet.com.au... >> Yes that is my initial thought... >> >> however I have cheched the application is using administrator as its >> identity. The effective permission for administrator is full access. I >> also checked Everyone user and it also has full access under effective >> permission. >> >> I'm really not sure what else could be wrong. >> >> Appreciate your help ! >> Tom >> >> "Dominick Baier [DevelopMentor]" <dbaier@pleasepleasenospamdevelop.com> >> wrote in message news:852930632616225320420418@news.microsoft.com... >>> Hello Tom, >>> >>> UnauthorizedException has nothing to do with CAS and FileIOPermission. >>> This is a OS level error - i would say you don't have the necessary NTFS >>> ACLs... >>> >>> --------------------------------------- >>> Dominick Baier - DevelopMentor >>> http://www.leastprivilege.com >>> >>>> Hi friends >>>> >>>> I am trying to modify a file on my computer but I get an error which >>>> says the following. "System.UnauthorizedAccessException: Access to the >>>> path. >>>> >>>> I also tried FileIOPermission >>>> >>>> FileIOPermission fio = new >>>> FileIOPermission(FileIOPermissionAccess.AllAccess, >>>> paramMP3.fileComplete); >>>> FileStream oFileStream; >>>> >>>> oFileStream = new FileStream(paramMP3.fileComplete , FileMode.Open, >>>> FileAccess.ReadWrite); >>>> >>>> that didn't seem to have any effect on it also. >>>> >>>> Appreciate any help >>>> >>>> Thanks >>>> >>>> Tom >>>> >>> >>> >>> >> >> > >
Possibtl to Create a Code Group Programmatically?
Single sign on in asp.net Signed XML Private Key X509 Certificate WSE 2.0 Issue\Errors IIS With Basic Authentication Set/FormsAuthentication - HELP PLS!? HttpWebRequest & https Certificate Valid Date Range LsaStorePrivateData and VB .Net Patterns for security Providing persistent storage in a locked down environment How to protect *.mdb file from direct access by client |
|||||||||||||||||||||||