添加文件然后自动打开

               //这里的案例是自动生成excel
string pathstr = System.Web.HttpContext.Current.Server.MapPath("/FilePath"); if (!System.IO.Directory.Exists(pathstr)) System.IO.Directory.CreateDirectory(pathstr); string filePath = Server.MapPath("/FilePath/" + filename); FileStream file = new FileStream(filePath, FileMode.Create); xssfworkbook.Write(file); file.Close();
//重点 System.Diagnostics.Process.Start(filePath);

 

posted @ 2019-09-17 16:46  没有狐狸的南墙  阅读(124)  评论(0编辑  收藏  举报