I need to read/write files. How do I find the correct path for my site?

The correct way to do this would be using Server.MapPath. This would map the virtual path to a physical location on the disk. Ex. If you have a file in your root web called visitor.txt and you use Server.MapPath("/visitor.txt") and the physical path to you root web was "F:\webs\yourweb" then it would return: "F:\webs\yourweb\visitor.txt" If you use this method you should never have to worry about the physical paths.

Add Feedback