You can use an alternatives as:-
string CustName = UserInformation.Rows[0]["TXT_Name"].ToString();
string deviceLogoPath = string.Format("../MapImages/DocFile/{0}", CustName);
if (Directory.Exists(Server.MapPath(deviceLogoPath)))
{
string existFile = Server.MapPath(string.Format("{0}/{1}", deviceLogoPath, deviceLogo.Trim()));
}
you can use ".." for virtual path instead of "~"