Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   UnauthorizedAccessException when reading XML files (no problem when reading other file-types) (http://www.velocityreviews.com/forums/t370852-unauthorizedaccessexception-when-reading-xml-files-no-problem-when-reading-other-file-types.html)

blabla120@gmx.net 09-15-2006 02:08 PM

UnauthorizedAccessException when reading XML files (no problem when reading other file-types)
 
Hi NG,

I want to read a xml-file from an asp-page:

// Kategorien aus xml laden
string pathKategorien =
Server.MapPath("./conf/kategorien.xml");
FileStream fs = new FileStream(pathKategorien, FileMode.Open,
FileAccess.Read, FileShare.ReadWrite);
StreamReader sr = new StreamReader( fs );
XmlSerializer s = new XmlSerializer( typeof( Kategorien ) );
_kat = (Kategorien)s.Deserialize( sr );

I get the Exceptio "UnauthorizedAccessException".

But I am sure that the Access rights are properly set, becaus it is no
problem to read a text-File from the same folder:

string pathKategorien = Server.MapPath("./conf/textfile.txt");

So I suppose there must be something special about XML-file concerning
file access rights.

Does anyone have a hint for me?

Thanx, Bernd



All times are GMT. The time now is 05:05 PM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57