471,831 Members | 775 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

ASP.NET Problems


I've just started writing in ASP.NET. I'm a bit new to this, so forgive me
for any newbie mistakes. I have a few questions. I'm trying to create a
logfile of people that visit my site, storing some info like IP, username,
and time. I'm trying to use streams in the code-behind page to append the
file, however I'm getting access denied errors and
System.UnAuthorizedAccessExceptions thrown. How do I set the permissions to
allow access to that file?

My second issue is this, when I want to access a file; How do I use relative
addressing? I tried using this (it is in the aspx.cs file which is located
in "C:\inetpub\wwwroot\testweb")
StreamWriter outStream = new StreamWriter("./logfile.txt",true);

to access a file that is physically located at
"C:\inetpub\wwwroot\testweb\logfile.txt". I would assume it would access
files relative to the location of the page (aspx and aspx.cs), but whenever
I run it, it goes to the C:\windows\system32 directory. Is there anyway to
change it so that the paths are relative to where the page is run from?

Jul 19 '05 #1
1 1050
Jim Lu wrote on 31 aug 2004 in microsoft.public.inetserver.asp.general:
I've just started writing in ASP.NET.

This is a classic ASP NG,
Please see an aspnet or dot.net group.

The Netherlands.
(Please change the x'es to dots in my emailaddress,
but let us keep the discussions in the newsgroup)

Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

14 posts views Thread by Jim Hubbard | last post: by
5 posts views Thread by Corky | last post: by
reply views Thread by Sergistm | last post: by
reply views Thread by YellowAndGreen | last post: by
reply views Thread by aboka | last post: by

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.