XML Closing error - UnauthorizedAccessException

  • Thread starter Thread starter Glyn Meek
  • Start date Start date
G

Glyn Meek

I have a line of code at the end of a program that is

xmldocparam.Save(filename)



We have ONE customer running on a Tmobile MDAII device who gets an error
whenever this line gets executed...I have 'trapped' the error and it says :



! UnauthorizedAccessException

I didn't know there wewre any access restrictions on the Pocket PC. Can
anyone give me a hint as to what is causing this exception on the particular
device?

Thanks

Glyn Meek
 
Most likely that's because file is opened by another application or is read
only.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
 
Ilya...thanks for the quick response. I thought it was a 'permissions'
thing, but how do I KNOW what permissions are for Pocket PC files, and how
do I change them?

Glyn



"Ilya Tumanov [MS]" said:
Most likely that's because file is opened by another application or is
read
only.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no
rights.
--------------------
From: "Glyn Meek" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
Subject: XML Closing error - UnauthorizedAccessException
Lines: 22
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Message-ID: <[email protected]>
Date: Wed, 23 Feb 2005 18:49:20 GMT
NNTP-Posting-Host: 63.246.189.227
X-Complaints-To: (e-mail address removed)
X-Trace: newsread1.news.pas.earthlink.net 1109184560 63.246.189.227 (Wed, 23 Feb 2005 10:49:20 PST)
NNTP-Posting-Date: Wed, 23 Feb 2005 10:49:20 PST
Organization: EarthLink Inc. -- http://www.EarthLink.net
Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.
sul.t-online.de!t-online.de!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink
.net!stamper.news.pas.earthlink.net!newsread1.news.pas.earthlink.net.POSTED!
fdcd6659!not-for-mail
Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.dotnet.framework.compactframework:71757
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

I have a line of code at the end of a program that is

xmldocparam.Save(filename)



We have ONE customer running on a Tmobile MDAII device who gets an error
whenever this line gets executed...I have 'trapped' the error and it says :



! UnauthorizedAccessException

I didn't know there wewre any access restrictions on the Pocket PC. Can
anyone give me a hint as to what is causing this exception on the particular
device?

Thanks

Glyn Meek
 
UnauthorizedAccessException is usually an equivalent of E_ACCESSDENIED ( =
5) Win32 error code. In particular for you scenario it is most likely that
CreateFile fails with GetLastError = 5 - hence the suggestions from Ilya and
myself to check the file for not being locked or read-only, and filename not
to clash with an existing directory. This has nothing to do with code
security or device being applocked


--
Alex Feinman
---
Visit http://www.opennetcf.org
Glyn Meek said:
Ilya...thanks for the quick response. I thought it was a 'permissions'
thing, but how do I KNOW what permissions are for Pocket PC files, and how
do I change them?

Glyn



"Ilya Tumanov [MS]" said:
Most likely that's because file is opened by another application or is
read
only.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no
rights.
--------------------
From: "Glyn Meek" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
Subject: XML Closing error - UnauthorizedAccessException
Lines: 22
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Message-ID: <[email protected]>
Date: Wed, 23 Feb 2005 18:49:20 GMT
NNTP-Posting-Host: 63.246.189.227
X-Complaints-To: (e-mail address removed)
X-Trace: newsread1.news.pas.earthlink.net 1109184560 63.246.189.227
(Wed, 23 Feb 2005 10:49:20 PST)
NNTP-Posting-Date: Wed, 23 Feb 2005 10:49:20 PST
Organization: EarthLink Inc. -- http://www.EarthLink.net
Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.
sul.t-online.de!t-online.de!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink
.net!stamper.news.pas.earthlink.net!newsread1.news.pas.earthlink.net.POSTED!
fdcd6659!not-for-mail
Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.dotnet.framework.compactframework:71757
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

I have a line of code at the end of a program that is

xmldocparam.Save(filename)



We have ONE customer running on a Tmobile MDAII device who gets an error
whenever this line gets executed...I have 'trapped' the error and it
says :



! UnauthorizedAccessException

I didn't know there wewre any access restrictions on the Pocket PC. Can
anyone give me a hint as to what is causing this exception on the particular
device?

Thanks

Glyn Meek
 
Alex...I understand this access issue may be the problem, as the file is NOT
clashing with an existing directory..

I truly don't know how to check for 'read only' status for Pocket PC files,
and I don't know how to change them, that's the problem I also suspect this
is the case, although I am not sure why it should be so on just this one
installation as we have about 4,000 others which are OK...but you never
know...LOL

Glyn





Alex Feinman said:
UnauthorizedAccessException is usually an equivalent of E_ACCESSDENIED ( =
5) Win32 error code. In particular for you scenario it is most likely that
CreateFile fails with GetLastError = 5 - hence the suggestions from Ilya
and myself to check the file for not being locked or read-only, and
filename not to clash with an existing directory. This has nothing to do
with code security or device being applocked


--
Alex Feinman
---
Visit http://www.opennetcf.org
Glyn Meek said:
Ilya...thanks for the quick response. I thought it was a 'permissions'
thing, but how do I KNOW what permissions are for Pocket PC files, and
how do I change them?

Glyn



"Ilya Tumanov [MS]" said:
Most likely that's because file is opened by another application or is
read
only.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no
rights.
--------------------
From: "Glyn Meek" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
Subject: XML Closing error - UnauthorizedAccessException
Lines: 22
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Message-ID: <[email protected]>
Date: Wed, 23 Feb 2005 18:49:20 GMT
NNTP-Posting-Host: 63.246.189.227
X-Complaints-To: (e-mail address removed)
X-Trace: newsread1.news.pas.earthlink.net 1109184560 63.246.189.227
(Wed,
23 Feb 2005 10:49:20 PST)
NNTP-Posting-Date: Wed, 23 Feb 2005 10:49:20 PST
Organization: EarthLink Inc. -- http://www.EarthLink.net
Path:
TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.
sul.t-online.de!t-online.de!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink
.net!stamper.news.pas.earthlink.net!newsread1.news.pas.earthlink.net.POSTED!
fdcd6659!not-for-mail
Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.compactframework:71757
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

I have a line of code at the end of a program that is

xmldocparam.Save(filename)



We have ONE customer running on a Tmobile MDAII device who gets an
error
whenever this line gets executed...I have 'trapped' the error and it
says
:



! UnauthorizedAccessException

I didn't know there wewre any access restrictions on the Pocket PC.
Can
anyone give me a hint as to what is causing this exception on the
particular
device?

Thanks

Glyn Meek
 
There are no permissions per se on PPC files. Thus you can't query or
change them.
You can use System.IO.FileInfo to handle r/o files.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
From: "Glyn Meek" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
References: <[email protected]>
Subject: Re: XML Closing error - UnauthorizedAccessException
Lines: 75
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Message-ID: <[email protected]>
Date: Wed, 23 Feb 2005 19:37:04 GMT
NNTP-Posting-Host: 63.246.189.227
X-Complaints-To: (e-mail address removed)
X-Trace: newsread3.news.pas.earthlink.net 1109187424 63.246.189.227 (Wed, 23 Feb 2005 11:37:04 PST)
NNTP-Posting-Date: Wed, 23 Feb 2005 11:37:04 PST
Organization: EarthLink Inc. -- http://www.EarthLink.net
Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.
sul.t-online.de!t-online.de!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink
..net!stamper.news.pas.earthlink.net!newsread3.news.pas.earthlink.net.POSTED!
fdcd6659!not-for-mail
Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.dotnet.framework.compactframework:71761
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

Ilya...thanks for the quick response. I thought it was a 'permissions'
thing, but how do I KNOW what permissions are for Pocket PC files, and how
do I change them?

Glyn



"Ilya Tumanov [MS]" said:
Most likely that's because file is opened by another application or is
read
only.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no
rights.
--------------------
From: "Glyn Meek" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
Subject: XML Closing error - UnauthorizedAccessException
Lines: 22
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Message-ID: <[email protected]>
Date: Wed, 23 Feb 2005 18:49:20 GMT
NNTP-Posting-Host: 63.246.189.227
X-Complaints-To: (e-mail address removed)
X-Trace: newsread1.news.pas.earthlink.net 1109184560 63.246.189.227
(Wed,
23 Feb 2005 10:49:20 PST)
NNTP-Posting-Date: Wed, 23 Feb 2005 10:49:20 PST
Organization: EarthLink Inc. -- http://www.EarthLink.net
Path:
TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.
sul.t-online.de!t-online.de!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink
..net!stamper.news.pas.earthlink.net!newsread1.news.pas.earthlink.net.POSTED!
fdcd6659!not-for-mail
Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.dotnet.framework.compactframework:71757
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

I have a line of code at the end of a program that is

xmldocparam.Save(filename)



We have ONE customer running on a Tmobile MDAII device who gets an error
whenever this line gets executed...I have 'trapped' the error and it
says
:
! UnauthorizedAccessException

I didn't know there wewre any access restrictions on the Pocket PC. Can
anyone give me a hint as to what is causing this exception on the particular
device?

Thanks

Glyn Meek
 
If you select the file with Windows Explorer and choose File | Properties,
it will show what attributes are set (in regular CE, anyway).

Paul T.
 
doesn't work on Pocket OS Paul...:-(



Paul G. Tobey said:
If you select the file with Windows Explorer and choose File | Properties,
it will show what attributes are set (in regular CE, anyway).

Paul T.
 
This seems like Catch 22, Ilya....

If there are no permissions on PPC files, then why am I running up against
access issues to do with read only permissions?...:-)

....and what would I need to do once I have determined using
System.IO.FileInfo that this is a read only file?

Glyn



"Ilya Tumanov [MS]" said:
There are no permissions per se on PPC files. Thus you can't query or
change them.
You can use System.IO.FileInfo to handle r/o files.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no
rights.
--------------------
From: "Glyn Meek" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
References: <[email protected]>
Subject: Re: XML Closing error - UnauthorizedAccessException
Lines: 75
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Message-ID: <[email protected]>
Date: Wed, 23 Feb 2005 19:37:04 GMT
NNTP-Posting-Host: 63.246.189.227
X-Complaints-To: (e-mail address removed)
X-Trace: newsread3.news.pas.earthlink.net 1109187424 63.246.189.227 (Wed, 23 Feb 2005 11:37:04 PST)
NNTP-Posting-Date: Wed, 23 Feb 2005 11:37:04 PST
Organization: EarthLink Inc. -- http://www.EarthLink.net
Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.
sul.t-online.de!t-online.de!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink
.net!stamper.news.pas.earthlink.net!newsread3.news.pas.earthlink.net.POSTED!
fdcd6659!not-for-mail
Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.dotnet.framework.compactframework:71761
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

Ilya...thanks for the quick response. I thought it was a 'permissions'
thing, but how do I KNOW what permissions are for Pocket PC files, and how
do I change them?

Glyn



"Ilya Tumanov [MS]" said:
Most likely that's because file is opened by another application or is
read
only.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no
rights.
--------------------
From: "Glyn Meek" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
Subject: XML Closing error - UnauthorizedAccessException
Lines: 22
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Message-ID: <[email protected]>
Date: Wed, 23 Feb 2005 18:49:20 GMT
NNTP-Posting-Host: 63.246.189.227
X-Complaints-To: (e-mail address removed)
X-Trace: newsread1.news.pas.earthlink.net 1109184560 63.246.189.227 (Wed,
23 Feb 2005 10:49:20 PST)
NNTP-Posting-Date: Wed, 23 Feb 2005 10:49:20 PST
Organization: EarthLink Inc. -- http://www.EarthLink.net
Path:
TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.
sul.t-online.de!t-online.de!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink
.net!stamper.news.pas.earthlink.net!newsread1.news.pas.earthlink.net.POSTED!
fdcd6659!not-for-mail
Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.compactframework:71757
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

I have a line of code at the end of a program that is

xmldocparam.Save(filename)



We have ONE customer running on a Tmobile MDAII device who gets an error
whenever this line gets executed...I have 'trapped' the error and it says
:



! UnauthorizedAccessException

I didn't know there wewre any access restrictions on the Pocket PC. Can
anyone give me a hint as to what is causing this exception on the
particular
device?

Thanks

Glyn Meek
 
They are not permissions - they are attributes

--
Alex Feinman
---
Visit http://www.opennetcf.org
Glyn Meek said:
This seems like Catch 22, Ilya....

If there are no permissions on PPC files, then why am I running up against
access issues to do with read only permissions?...:-)

...and what would I need to do once I have determined using
System.IO.FileInfo that this is a read only file?

Glyn



"Ilya Tumanov [MS]" said:
There are no permissions per se on PPC files. Thus you can't query or
change them.
You can use System.IO.FileInfo to handle r/o files.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no
rights.
--------------------
From: "Glyn Meek" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
References: <[email protected]>
Subject: Re: XML Closing error - UnauthorizedAccessException
Lines: 75
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Message-ID: <[email protected]>
Date: Wed, 23 Feb 2005 19:37:04 GMT
NNTP-Posting-Host: 63.246.189.227
X-Complaints-To: (e-mail address removed)
X-Trace: newsread3.news.pas.earthlink.net 1109187424 63.246.189.227
(Wed, 23 Feb 2005 11:37:04 PST)
NNTP-Posting-Date: Wed, 23 Feb 2005 11:37:04 PST
Organization: EarthLink Inc. -- http://www.EarthLink.net
Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.
sul.t-online.de!t-online.de!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink
.net!stamper.news.pas.earthlink.net!newsread3.news.pas.earthlink.net.POSTED!
fdcd6659!not-for-mail
Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.dotnet.framework.compactframework:71761
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

Ilya...thanks for the quick response. I thought it was a 'permissions'
thing, but how do I KNOW what permissions are for Pocket PC files, and how
do I change them?

Glyn



Most likely that's because file is opened by another application or is
read
only.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no
rights.
--------------------
From: "Glyn Meek" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
Subject: XML Closing error - UnauthorizedAccessException
Lines: 22
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Message-ID: <[email protected]>
Date: Wed, 23 Feb 2005 18:49:20 GMT
NNTP-Posting-Host: 63.246.189.227
X-Complaints-To: (e-mail address removed)
X-Trace: newsread1.news.pas.earthlink.net 1109184560 63.246.189.227 (Wed,
23 Feb 2005 10:49:20 PST)
NNTP-Posting-Date: Wed, 23 Feb 2005 10:49:20 PST
Organization: EarthLink Inc. -- http://www.EarthLink.net
Path:
TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.
sul.t-online.de!t-online.de!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink
.net!stamper.news.pas.earthlink.net!newsread1.news.pas.earthlink.net.POSTED!
fdcd6659!not-for-mail
Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.compactframework:71757
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

I have a line of code at the end of a program that is

xmldocparam.Save(filename)



We have ONE customer running on a Tmobile MDAII device who gets an error
whenever this line gets executed...I have 'trapped' the error and it says
:



! UnauthorizedAccessException

I didn't know there wewre any access restrictions on the Pocket PC. Can
anyone give me a hint as to what is causing this exception on the
particular
device?

Thanks

Glyn Meek
 
ah isn't semantics a wonderful thing?


LOL

BUT...if the fact that an 'attribute' is set to read-only is not allowing me
to write to the file, then isn't it also a 'permission'?

G
Alex Feinman said:
They are not permissions - they are attributes

--
Alex Feinman
---
Visit http://www.opennetcf.org
Glyn Meek said:
This seems like Catch 22, Ilya....

If there are no permissions on PPC files, then why am I running up
against access issues to do with read only permissions?...:-)

...and what would I need to do once I have determined using
System.IO.FileInfo that this is a read only file?

Glyn



"Ilya Tumanov [MS]" said:
There are no permissions per se on PPC files. Thus you can't query or
change them.
You can use System.IO.FileInfo to handle r/o files.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no
rights.
--------------------
From: "Glyn Meek" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
References: <[email protected]>
<ODgR#[email protected]>
Subject: Re: XML Closing error - UnauthorizedAccessException
Lines: 75
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Message-ID: <[email protected]>
Date: Wed, 23 Feb 2005 19:37:04 GMT
NNTP-Posting-Host: 63.246.189.227
X-Complaints-To: (e-mail address removed)
X-Trace: newsread3.news.pas.earthlink.net 1109187424 63.246.189.227
(Wed,
23 Feb 2005 11:37:04 PST)
NNTP-Posting-Date: Wed, 23 Feb 2005 11:37:04 PST
Organization: EarthLink Inc. -- http://www.EarthLink.net
Path:
TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.
sul.t-online.de!t-online.de!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink
.net!stamper.news.pas.earthlink.net!newsread3.news.pas.earthlink.net.POSTED!
fdcd6659!not-for-mail
Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.compactframework:71761
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

Ilya...thanks for the quick response. I thought it was a 'permissions'
thing, but how do I KNOW what permissions are for Pocket PC files, and
how
do I change them?

Glyn



Most likely that's because file is opened by another application or
is
read
only.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no
rights.
--------------------
From: "Glyn Meek" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
Subject: XML Closing error - UnauthorizedAccessException
Lines: 22
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Message-ID: <[email protected]>
Date: Wed, 23 Feb 2005 18:49:20 GMT
NNTP-Posting-Host: 63.246.189.227
X-Complaints-To: (e-mail address removed)
X-Trace: newsread1.news.pas.earthlink.net 1109184560 63.246.189.227
(Wed,
23 Feb 2005 10:49:20 PST)
NNTP-Posting-Date: Wed, 23 Feb 2005 10:49:20 PST
Organization: EarthLink Inc. -- http://www.EarthLink.net
Path:

TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.

sul.t-online.de!t-online.de!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink

.net!stamper.news.pas.earthlink.net!newsread1.news.pas.earthlink.net.POSTED!
fdcd6659!not-for-mail
Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.compactframework:71757
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

I have a line of code at the end of a program that is

xmldocparam.Save(filename)



We have ONE customer running on a Tmobile MDAII device who gets an
error
whenever this line gets executed...I have 'trapped' the error and it
says
:



! UnauthorizedAccessException

I didn't know there wewre any access restrictions on the Pocket PC.
Can
anyone give me a hint as to what is causing this exception on the
particular
device?

Thanks

Glyn Meek
 
There's no catch. R/O attribute was around for a very long time and it has
nothing to do with permissions.
Unlike permissions, it won't limit your ability to do whatever you want
with this file (if you know how to reset it).

Here's how:

using System;
using System.Data;
using System.IO;
using System.Text;
using System.Xml;
using System.Windows.Forms;

namespace tests
{
class Class1
{
static void Main(string[] args)
{
if (args.Length > 0) {

FileInfo fi = new FileInfo (args[0]);

Console.WriteLine ("File '{0}' Attributes: {1}", args[0],
fi.Attributes);

Console.WriteLine ("Flipping R/O attribute...");

fi.Attributes ^= FileAttributes.ReadOnly;

Console.WriteLine ("File '{0}' attributes: {1}", args[0],
fi.Attributes);

}
}
}
}

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
From: "Glyn Meek" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
References: <[email protected]>
<ODgR#[email protected]>
Subject: Re: XML Closing error - UnauthorizedAccessException
Lines: 140
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
Message-ID: <[email protected]>
Date: Wed, 23 Feb 2005 20:31:10 GMT
NNTP-Posting-Host: 63.246.189.227
X-Complaints-To: (e-mail address removed)
X-Trace: newsread3.news.pas.earthlink.net 1109190670 63.246.189.227 (Wed, 23 Feb 2005 12:31:10 PST)
NNTP-Posting-Date: Wed, 23 Feb 2005 12:31:10 PST
Organization: EarthLink Inc. -- http://www.EarthLink.net
Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.
sul.t-online.de!t-online.de!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink
..net!stamper.news.pas.earthlink.net!newsread3.news.pas.earthlink.net.POSTED!
fdcd6659!not-for-mail
Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.dotnet.framework.compactframework:71768
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

This seems like Catch 22, Ilya....

If there are no permissions on PPC files, then why am I running up against
access issues to do with read only permissions?...:-)

...and what would I need to do once I have determined using
System.IO.FileInfo that this is a read only file?

Glyn



"Ilya Tumanov [MS]" said:
There are no permissions per se on PPC files. Thus you can't query or
change them.
You can use System.IO.FileInfo to handle r/o files.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no
rights.
--------------------
From: "Glyn Meek" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
References: <[email protected]>
Subject: Re: XML Closing error - UnauthorizedAccessException
Lines: 75
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Message-ID: <[email protected]>
Date: Wed, 23 Feb 2005 19:37:04 GMT
NNTP-Posting-Host: 63.246.189.227
X-Complaints-To: (e-mail address removed)
X-Trace: newsread3.news.pas.earthlink.net 1109187424 63.246.189.227
(Wed,
23 Feb 2005 11:37:04 PST)
NNTP-Posting-Date: Wed, 23 Feb 2005 11:37:04 PST
Organization: EarthLink Inc. -- http://www.EarthLink.net
Path:
TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.
sul.t-online.de!t-online.de!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink
..net!stamper.news.pas.earthlink.net!newsread3.news.pas.earthlink.net.POSTED!
fdcd6659!not-for-mail
Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.dotnet.framework.compactframework:71761
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

Ilya...thanks for the quick response. I thought it was a 'permissions'
thing, but how do I KNOW what permissions are for Pocket PC files, and how
do I change them?

Glyn



Most likely that's because file is opened by another application or is
read
only.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no
rights.
--------------------
From: "Glyn Meek" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
Subject: XML Closing error - UnauthorizedAccessException
Lines: 22
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Message-ID: <[email protected]>
Date: Wed, 23 Feb 2005 18:49:20 GMT
NNTP-Posting-Host: 63.246.189.227
X-Complaints-To: (e-mail address removed)
X-Trace: newsread1.news.pas.earthlink.net 1109184560 63.246.189.227 (Wed,
23 Feb 2005 10:49:20 PST)
NNTP-Posting-Date: Wed, 23 Feb 2005 10:49:20 PST
Organization: EarthLink Inc. -- http://www.EarthLink.net
Path:
TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00. sul.t-online.de!t-online.de!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink ..net!stamper.news.pas.earthlink.net!newsread1.news.pas.earthlink.net.POSTED!
fdcd6659!not-for-mail
Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.compactframework:71757
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

I have a line of code at the end of a program that is

xmldocparam.Save(filename)



We have ONE customer running on a Tmobile MDAII device who gets an error
whenever this line gets executed...I have 'trapped' the error and it says
:



! UnauthorizedAccessException

I didn't know there wewre any access restrictions on the Pocket PC. Can
anyone give me a hint as to what is causing this exception on the
particular
device?

Thanks

Glyn Meek
 
my thanks for finally explaining this well Mr Tumanov!!!!

Regards and best wishes

Glyn



"Ilya Tumanov [MS]" said:
There's no catch. R/O attribute was around for a very long time and it has
nothing to do with permissions.
Unlike permissions, it won't limit your ability to do whatever you want
with this file (if you know how to reset it).

Here's how:

using System;
using System.Data;
using System.IO;
using System.Text;
using System.Xml;
using System.Windows.Forms;

namespace tests
{
class Class1
{
static void Main(string[] args)
{
if (args.Length > 0) {

FileInfo fi = new FileInfo (args[0]);

Console.WriteLine ("File '{0}' Attributes: {1}", args[0],
fi.Attributes);

Console.WriteLine ("Flipping R/O attribute...");

fi.Attributes ^= FileAttributes.ReadOnly;

Console.WriteLine ("File '{0}' attributes: {1}", args[0],
fi.Attributes);

}
}
}
}

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no
rights.
--------------------
From: "Glyn Meek" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
References: <[email protected]>
<ODgR#[email protected]>
Subject: Re: XML Closing error - UnauthorizedAccessException
Lines: 140
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
Message-ID: <[email protected]>
Date: Wed, 23 Feb 2005 20:31:10 GMT
NNTP-Posting-Host: 63.246.189.227
X-Complaints-To: (e-mail address removed)
X-Trace: newsread3.news.pas.earthlink.net 1109190670 63.246.189.227 (Wed, 23 Feb 2005 12:31:10 PST)
NNTP-Posting-Date: Wed, 23 Feb 2005 12:31:10 PST
Organization: EarthLink Inc. -- http://www.EarthLink.net
Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.
sul.t-online.de!t-online.de!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink
.net!stamper.news.pas.earthlink.net!newsread3.news.pas.earthlink.net.POSTED!
fdcd6659!not-for-mail
Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.dotnet.framework.compactframework:71768
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

This seems like Catch 22, Ilya....

If there are no permissions on PPC files, then why am I running up against
access issues to do with read only permissions?...:-)

...and what would I need to do once I have determined using
System.IO.FileInfo that this is a read only file?

Glyn



"Ilya Tumanov [MS]" said:
There are no permissions per se on PPC files. Thus you can't query or
change them.
You can use System.IO.FileInfo to handle r/o files.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no
rights.
--------------------
From: "Glyn Meek" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
References: <[email protected]>
<ODgR#[email protected]>
Subject: Re: XML Closing error - UnauthorizedAccessException
Lines: 75
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Message-ID: <[email protected]>
Date: Wed, 23 Feb 2005 19:37:04 GMT
NNTP-Posting-Host: 63.246.189.227
X-Complaints-To: (e-mail address removed)
X-Trace: newsread3.news.pas.earthlink.net 1109187424 63.246.189.227 (Wed,
23 Feb 2005 11:37:04 PST)
NNTP-Posting-Date: Wed, 23 Feb 2005 11:37:04 PST
Organization: EarthLink Inc. -- http://www.EarthLink.net
Path:
TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.
sul.t-online.de!t-online.de!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink
.net!stamper.news.pas.earthlink.net!newsread3.news.pas.earthlink.net.POSTED!
fdcd6659!not-for-mail
Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.compactframework:71761
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

Ilya...thanks for the quick response. I thought it was a
'permissions'
thing, but how do I KNOW what permissions are for Pocket PC files, and
how
do I change them?

Glyn



Most likely that's because file is opened by another application or is
read
only.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no
rights.
--------------------
From: "Glyn Meek" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
Subject: XML Closing error - UnauthorizedAccessException
Lines: 22
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Message-ID: <[email protected]>
Date: Wed, 23 Feb 2005 18:49:20 GMT
NNTP-Posting-Host: 63.246.189.227
X-Complaints-To: (e-mail address removed)
X-Trace: newsread1.news.pas.earthlink.net 1109184560 63.246.189.227
(Wed,
23 Feb 2005 10:49:20 PST)
NNTP-Posting-Date: Wed, 23 Feb 2005 10:49:20 PST
Organization: EarthLink Inc. -- http://www.EarthLink.net
Path:

TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.

sul.t-online.de!t-online.de!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink

.net!stamper.news.pas.earthlink.net!newsread1.news.pas.earthlink.net.POSTED!
fdcd6659!not-for-mail
Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.compactframework:71757
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

I have a line of code at the end of a program that is

xmldocparam.Save(filename)



We have ONE customer running on a Tmobile MDAII device who gets an
error
whenever this line gets executed...I have 'trapped' the error and
it
says
:



! UnauthorizedAccessException

I didn't know there wewre any access restrictions on the Pocket PC.
Can
anyone give me a hint as to what is causing this exception on the
particular
device?

Thanks

Glyn Meek
 
Back
Top