C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




The MapPath method


Posted Date: 11 Mar 2004    Resource Type: Articles    Category: Web Applications
Author: Satheesh SugumaranMember Level: Gold    
Rating: Points: 5



The ASP.NET Page object exposes the MapPath method, which converts a virtual path into a physical path, so it' is useful for passing arguments to objects that don't work with virtual paths:

Dim sr As New System.IO.StreamReader(Me.MapPath("/data/values.dat"))

You can also use MapPath to retrieve information onabout the current ASP.NET application, for example as you see in this snippet:

' The current directory
Dim currDir As String = Me.MapPath(".")
' The parent directory
Dim parentDir As String = Me.MapPath("..")
' The root directory
Dim rootDir As String = Me.MapPath("/")





Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Dynamically moving a server control
Previous Resource: Display two fields in one datagrid column
Return to Discussion Resource Index
Post New Resource
Category: Web Applications


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design


Contact Us    Privacy Policy    Terms Of Use