Solved

Visual Web Developer Need Path to Web root directory

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
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…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

759 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

19 Experts available now in Live!

Get 1:1 Help Now