473,385 Members | 1,267 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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

Sep 15 '06 #1
0 1301

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Jens Nilson | last post by:
My company has a web application for downloading and uploading of reports in MS Office formats. The application has been working fine until we added certificate for secure transfer. Now, when the...
0
by: PeterB | last post by:
Hi! I am using the script below to download files, that are in a non-public directory, from my site. The "smaller files" section works for smaller files. However when the files are getting...
2
by: WahJava | last post by:
Hi developers, I'm running GCC (GNU C/C++ Compiler shipped with Fedora Core 2). I've written a program using IOStream classes, in which I'm reading files in ios::binary mode. I'm using read()...
10
by: Tom Szabo | last post by:
Is there an event when that triggers when the window is closing.... I am talking about when the user clicks on the cross on the right top corner of the window!!!
3
by: Mamatha | last post by:
Hi I want to delete or clean all files when i click on uninstall. How can i do this ,if any one knows the solution please let me know,this is very urgent need for me Thanks in advance. ...
10
by: Johhny | last post by:
Hello All, I am working my way through learning python as a language. I am having some issues with something that looks right and does not work. I am trying to get myself more familure with...
1
by: farseer | last post by:
Hi, I am storing certain files in the same directory as an asp page. I'd like for that page to be able to read read the names of the files in that directory with a certain extension and create a...
7
by: pedagani | last post by:
Dear comp.lang.c++, I'm trying to read a file with very long filename using ifstream. Although, the file exists the file open for read fails. Is there a restriction on the size? I'm using winXP...
2
by: supra91 | last post by:
Hi, I have to read files from the parent directory and delete those files. This parent directory contains logs files. This directory also contains some sub directories and I do not want to delete...
4
by: Miner Jeff | last post by:
Hello, I have a basic question about reading files. I have several data files where the filenames are identical except for a short (3 character) prefix. I inherited this code and the person who...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.