public string GetDataDir() { // Gets the web application's path. string path = Server.MapPath("~"); path = path.Replace("CSharp", "Data"); path = path.Substring(0, path.LastIndexOf("\\")); return path; } }