file io tofrom app_data

Discussion in 'ASP.NET 2.0' started by m3src, Jun 1, 2006.

  1. Hello
    I want to be able to create and read a file. I don't want to specify an absolute path, but rather a path releative to my website (I guess preferable in \app_data)but Iam not sure what to specify in the fileopen call. I have tried ".\app_data\filename.txt" but that does not seem to work. Any help would be appreciated.

    Thanks
    Mike
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    You can use

    server.mappath function

    eg. if you want to create file under \app_data directory, you would use server.mappath('/app_data').

    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  3. Bruce


    Thanks for the help and input.


    Mike
     

Share This Page