1

System.IO.File.Exists not working after publishing the website.I need to check whether an exe file already exist in a path using 'System.IO.File.Exists'.It worked fine in localhost ,but not working after publishing the site.I think its due to permission any alternative exists?please help.

My code like:

foreach (var item in reslt)
        {
            if (System.IO.File.Exists(item.Path))
            {
                flag = true;
                using (APM context = new APM())
                {
                    var res = (
                        from s in context.T_SoftwarePath
                        where s.UserID == user
                        select s).ToList();
                    res.ForEach(s => s.Value = twoinone);
                    context.SaveChanges();
                }

                Process.Start(item.Path);
                break;
            }
        }

        if (flag == false)
        {
            f1 = Download(twoinone);
        }
pijemcolu
  • 2,257
  • 22
  • 36
neethu
  • 193
  • 1
  • 3
  • 14

0 Answers0