ユーザーが保存するためにリンクがクリックされたときに.CSVファイルを返す次のコードがあります。
public FileContentResult DownloadCSV()
{
StringBuilder sb = new StringBuilder();
var props = typeof(PenCalcModel).GetProperties();
var penSummary = PenSummaryReport(new DateTime(DateTime.Today.Ticks, DateTimeKind.Utc), new DateTime(DateTime.Today.AddDays(1).Ticks, DateTimeKind.Utc), "");
foreach (PenCalcModel item in penSummary)
{
sb.Append(string.Join(",", props.Select(p=>p.GetValue(item,null).ToString())));
sb.AppendLine();
}
return File(new System.Text.UTF8Encoding().GetBytes(sb.ToString()), "text/csv", "PenReport.csv");
}
これとまったく同じ.CSVファイルをサーバーからネットワークドライブにX時間ごとにエクスポートするように設定する方法はありますか?