PathName to Use to Write Files

Discussion in 'ASP.NET / ASP.NET Core' started by gotherthanthou, May 18, 2009.

  1. My domain name is jtbmax.com. My site has need to write files to it's own directory structure. So say if I have /TestApp enabled as a web app, and I want to:

    dim wrtr as StreamWriter = new Streamwriter(fullyqualifiedpathofTestApp + "\DynamicTextFiles\testfile.txt")
    wrtr.WriteLine("Test Line")

    What should fullyqualifiedpathofTestApp be, and should I be using forward or backword slashes?
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    yeah.. always use server.mappath Unless you include the path in your web.config.
     

Share This Page