Verify if file exists or not in C#

后端 未结 12 1371
名媛妹妹
名媛妹妹 2020-12-15 17:19

I am working on an application. That application should get the resume from the users, so that I need a code to verify whether a file exists or not.

I\'m using ASP.N

12条回答
  •  臣服心动
    2020-12-15 17:54

        if (File.Exists(Server.MapPath("~/Images/associates/" + Html.DisplayFor(modelItem => item.AssociateImage)))) 
          { 
             
          }
            else 
          { 
            
    No image available
    }

    I did something like this for checking to see if an image existed before displaying it.

提交回复
热议问题