在C#的配置文件中,怎样写?或者在其他地方。怎样写呢?

解决方案 »

  1.   

    if (File.Exists(filePath))
    {
      存在
    }
      

  2.   

    if(new FileInfo(filePath).Exists)
    {
         存在
    }
      

  3.   


            if (File.Exists(filePath))//判断文件是否存在
            {
                Response.AddHeader("Content-Disposition", "attachment;filename=" + Server.UrlEncode(LinDown1.Text));
                Response.TransmitFile(filePath);//写到输出流中
            }
            else
            {
                Response.Write("不存在该文件");
            }
      

  4.   

    if(new FileInfo(filePath).Exists)
    {
      存在
    }
      

  5.   

    if   (File.Exists(filePath)) 

        存在 
    }