string url = ""; string[] urls = Directory.GetFiles(目录, 文件名, SearchOption.AllDirectories); if (urls != null && urls.Length > 0) url = urls.First();