Solved

Visual Web Developer Need Path to Web root directory

Posted on 2007-04-07
2
464 Views
Last Modified: 2013-11-27
Hello Experts,
I am using Visual Web Developer from VS2005.

I want my web page to open a sequential log file and write a record into it.  I have the following code which executes.  However, I have no idea where the record is written.  This is my vb code:
        Dim writer As StreamWriter = _
            New StreamWriter("admit.log")
        writer.WriteLine("This is a sample log record.")
        writer.Close()
I want the file admit.log written in my web root directory.  I need to determine the path to that directory.  I need something like the VBSCRIPT Server.MapPath.

Any ideas?  Thanks in advance
0
Comment
Question by:GeneM
2 Comments
 
LVL 14

Accepted Solution

by:
existenz2 earned 250 total points
ID: 18871862
Server.MapPath does the trick.
0
 
LVL 3

Author Comment

by:GeneM
ID: 18873243
You are correct.  I had tried it previously but could not make it work.  However, I discovered I had a problem with authorizations, so when that was corrected, the MapPath method worked great.

Thanks for the response.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question