#region 取得目前可用的檔案清單
/// <summary>
/// 取得目前可用的檔案清單
/// </summary>
/// <param name="IsAlert">是否需要彈出提示訊息</param>
private void fn_getCurrFileList(bool IsAlert)
{
try
{
// 尋找 XMLzip 資料夾下屬於本身 UnitCoding 的相關 zip 檔案
string strXmlZipDirectory = Server.MapPath("../XMLzip/");
if (Directory.Exists(strXmlZipDirectory))
{
DirectoryInfo di = new DirectoryInfo(strXmlZipDirectory);
FileInfo[] FI = di.GetFiles("*.zip"); // 僅查詢 .zip 檔案
if (FI.Length > 0)
{
lst_DownLoadFileList.Items.Clear();
foreach (FileInfo tmpFI in FI)
{
ListItem tmpItem = new ListItem();
tmpItem.Text = tmpFI.Name;
lst_DownLoadFileList.Items.Add(tmpItem);
}
lst_DownLoadFileList.SelectedIndex = 0;
}
else
{
if (IsAlert)
{
Response.Write("查無可下載的檔案!");
}
}
}
}
catch (Exception ex)
{
ex.ToString(); // 建議記錄日誌
}
}
#endregion
更多詳細內容將於後續補充。