Monday, February 15, 2010

What is a MapPath?

When we are working on a remote server, we may not know the exact path. Using the MapPath method, we can map a specified virtual path to a physical path. If we do not know the exact path, simply we can enter the name of the text file we wish to create, and it is created in our root directory with the ASPX and CS file of our web site. The format is

using (StreamWriter swInstance = new StreamWriter MapPath(“shri.txt”))
{
……

}

No comments:

Post a Comment