using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace DownloadFileTest.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            return View();
        }

        public ActionResult About()
        {
            ViewBag.Message = "Your application description page.";

            return View();
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "Your contact page.";

            return View();
        }

        public ActionResult DownloadFile()
        {
            string path = Server.MapPath(@"~\Content\Site.css");
            return File(path, "application/octet-stream");
        }
    }
}

arrow
arrow
    文章標籤
    C# asp.net mvc download file
    全站熱搜

    痞客興 發表在 痞客邦 留言(0) 人氣()