writing XML file error

S

Salim Afþar

Hi,
I get an error (Access to the path "C:\Inetpub\wwwroot\LE\SMS\Mesaj_One.xml"
is denied.) when I do this:
string filename =Request.PhysicalApplicationPath.ToString() +
"/Mesaj_One.xml";
FileStream myFileStream = new FileStream(filename,
System.IO.FileMode.Create);
XmlTextWriter myXmlWriter = new XmlTextWriter(myFileStream,
System.Text.Encoding.Unicode);
dsWrite.WriteXml(myXmlWriter);

Any idea please,
Thanks in advence,
Salim
 
K

Kevin Spencer

The account under which your application is running doesn't have the
necessary permission.
--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Big things are made up of
lots of little things.
 
R

Ravikanth[MVP]

Hi
Give ASP.NET User Account write permission on the web
folder where you would like to create xml file.

Ravikanth

-----Original Message-----
Hi,
I get an error (Access to the
path "C:\Inetpub\wwwroot\LE\SMS\Mesaj_One.xml"
 
J

Jan

Ravikanth said:
Hi
Give ASP.NET User Account write permission on the web
folder where you would like to create xml file.

How do you do that in WinXP Pro??? I can not find any security/access
property settings.

Jan
 
K

Kevin Spencer

If you're running XP Pro and your computer is not a member of a domain, you
need to go into Control Panel, Folder Options. In the View tab, uncheck "Use
Simple File Sharing" and you will be able to see the Security tab in your
Folder Properties dialog boxes.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Big things are made up of
lots of little things.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top