473,804 Members | 3,744 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

UnauthorizedAcc essException 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(path Kategorien, FileMode.Open,
FileAccess.Read , FileShare.ReadW rite);
StreamReader sr = new StreamReader( fs );
XmlSerializer s = new XmlSerializer( typeof( Kategorien ) );
_kat = (Kategorien)s.D eserialize( sr );

I get the Exceptio "UnauthorizedAc cessException".

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 1324

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

Similar topics

0
1469
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 files have been uploaded and then downloaded, I get an alert saying "select the encoding that makes your document readable". In the preview box, a line of ASP code (a line with a file include) is displayed and there after alot of squares and other...
0
2095
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 larger, it won't work! I'm not sure what the size limit is, or if it is some kind of timeout, which would mean very small files if the connection is slow (I'm working against a server on the LAN). When I try to download larger files with the "small...
2
2705
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() method (exact signature not remembered) of the std::istream class ? When I'm reading the value in objects attribute (member variable), the read fails, but when I'm reading in a local variable value is successfully read as shown below: ..... any...
10
9818
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
1083
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. Mamatha
10
2144
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 reading files. Based on the tutorials at www.python.org This "should" work. but im not sure what the issue is. ===SNIP=== import string
1
1372
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 hyperlink to them. How can i do this. as an example... let's say my page resides at /mysite/dir1/default.aspx. now in /mysite/dir1 are the files pic.jpg, pic1.jpg, pic2.jpg.
7
4943
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 with VS2005. Please advice. Thank you.
2
3850
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 files from these sub directories. I am using this code opendir(DIR, $lpath); @flist = readdir(DIR); closedir(DIR); when I do this @flist also contains files from sub directories and I do want that. How can I avoid reading files from...
4
1902
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 developed it was making a duplicate of each file and then deleting the prefix on the copied file so the following statement could read a generic "filename":
0
9706
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10569
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10325
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
6847
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5519
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4295
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3815
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2990
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.