Solved

Visual Web Developer Need Path to Web root directory

Posted on 2007-04-07
2
462 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
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…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

948 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now