【发布时间】:2010-09-06 04:07:24
【问题描述】:
基本上我有一些代码来检查特定目录以查看图像是否存在,如果存在,我想将图像的 URL 分配给 ImageControl。
if (System.IO.Directory.Exists(photosLocation))
{
string[] files = System.IO.Directory.GetFiles(photosLocation, "*.jpg");
if (files.Length > 0)
{
// TODO: return the url of the first file found;
}
}
【问题讨论】: