Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Access to the path is denied
Message
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Securité
Titre:
Access to the path is denied
Divers
Thread ID:
00867208
Message ID:
00867208
Vues:
59
What would cause the following code to catch the error: "Access to the path is denied"? I have given the ASPNET and the IUSER_* account full control to this folder and all subfolders as well as ensured the readonly attributes are cleared on all files and folders. I have also given read,write, and borwse rights to this folder from within the IIS administrator. When I run this on my development machine which does not have NTFS, everything works fine.
FileName = dgi.Cells[2].Text;
try
{
  string AckFolder = @"Files/UNRESOLVED/Bad Files/";
  string Unresolved = @"Files/Unresolved/";
  string FileName = "";
  FileInfo fn;
  // will move backup + log file to the Bad Files folder.
  fn = new FileInfo(Server.MapPath(Unresolved+FileName));
  if (fn.Exists) fn.MoveTo(Server.MapPath(AckFolder+fn.Name));
  fn = new FileInfo(Server.MapPath(Unresolved + fn.Name.Replace(fn.Extension,".log")));
  if (fn.Exists) fn.MoveTo(Server.MapPath(AckFolder+fn.Name));
     bUpdated = true;
}
catch (Exception ex)
{
  this.lbl_message.Text=ex.Message;
  this.lbl_message.Visible=true;
  return;
}
Répondre
Fil
Voir

Click here to load this message in the networking platform