curiouswebster
asked on
What does Request.MapPath() do and how does it work?
I want to access a file that's in a folder for the default Physical Path. So the following code works:
String outPutPath = Path.GetDirectoryName(Requ est.Physic alPath) + "\\output";
StreamWriter w = File.AppendText(outPutPath + "\\xmleventsincall.txt");
Is there a nicer way of doing this using MapPath()?
Thanks,
newbieweb
String outPutPath = Path.GetDirectoryName(Requ
StreamWriter w = File.AppendText(outPutPath
Is there a nicer way of doing this using MapPath()?
Thanks,
newbieweb
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
above not worked?
ASKER
Yes, but what is keeping track of the location of "Hello.aspx"? And what if there are two copies of that file in different directories?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
so does that mean IIS does not allow you to have the same file in two subfolders?
ASKER
In your example, Hello.aspx is located in three folders. I don't see how it can tell you the path in that case.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks.