ASP.NET Problems

Discussion in 'ASP General' started by Jim Lu, Aug 31, 2004.

  1. Jim Lu

    Jim Lu Guest

    Hi,

    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?

    Thanks,
    Jim
     
    Jim Lu, Aug 31, 2004
    #1
    1. Advertising

  2. Jim Lu

    Evertjan. Guest

    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.

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress,
    but let us keep the discussions in the newsgroup)
     
    Evertjan., Aug 31, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Stephen Gutknecht \(RS\)
    Replies:
    1
    Views:
    485
    Ravikanth[MVP]
    Aug 1, 2003
  2. sacred_warrior
    Replies:
    0
    Views:
    317
    sacred_warrior
    Jul 27, 2005
  3. jb
    Replies:
    3
    Views:
    2,142
    =?Utf-8?B?U3VicmFtYW5pYW4gQVBM?=
    Aug 24, 2006
  4. Dinis Cruz
    Replies:
    1
    Views:
    127
    Susan Bradley, CPA aka Ebitz - SBS Rocks [MVP]
    Oct 17, 2003
  5. Rob R. Ainscough

    VS.NET 2003 using ASP.NET & VB.NET -- IDE design time problems?

    Rob R. Ainscough, May 5, 2005, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    188
    Rob R. Ainscough
    May 6, 2005
Loading...

Share This Page