For finding folder or file path in the server, we have to use System.Web.HttpContext.Current.Server.MapPath("").
protected void Page_Load(object sender, EventArgs e)
{
string imgName = "RangaRajesh.jpg";
string strFilePath=System.Web.HttpContext.Current.Server.MapPath("~") + "\\images\\"+imgName;
//output is : D:\\Ranga Rajesh Kumar\\practice1\\images\\RangaRajesh.jpg
}
Post a Comment
Please give your valuable feedback on this post. You can submit any ASP.NET article here. We will post that article in this website by your name.