/// <summary>
/// 判断是否有图片
/// </summary>
/// <param name="folderPath">指定文件夹路径</param>
/// <returns>bool</returns>
public bool judgeExpensionName(string folderPath)
{
bool isTp = false;
if (Directory.Exists(folderPath))
{
foreach (string itemFilePath in Directory.GetFiles(folderPath))
{
FileInfo fi = new FileInfo(itemFilePath);
//创建时间 fi.CreationTime;
//获取上次访问当前目录时间 fi.LastAccessTime
//获取上次写入文件目录的时间 fi.LastWriteTime
if (fi.Extension.Equals(".jpg") || fi.Extension.Equals(".JPG") || fi.Extension.Equals(".jpge") || fi.Extension.Equals(".JPEG") || fi.Extension.Equals(".gif") || fi.Extension.Equals(".GIF"))
{
isTp = true;
break;
}
else
isTp = false;
}
}
return isTp;
}
黑色头发:http://heisetoufa.iteye.com/