Solved

Visual Web Developer Need Path to Web root directory

Posted on 2007-04-07
2
473 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

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 …
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
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…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

630 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