添加文件然后自动打开
生活随笔
收集整理的這篇文章主要介紹了
添加文件然后自动打开
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
//這里的案例是自動(dòng)生成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();
//重點(diǎn)System.Diagnostics.Process.Start(filePath);
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();
//重點(diǎn)System.Diagnostics.Process.Start(filePath);
?
轉(zhuǎn)載于:https://www.cnblogs.com/shanshuiYiCheng/p/11535184.html
總結(jié)
以上是生活随笔為你收集整理的添加文件然后自动打开的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 程序员利用测试账户套现千万美元,或面临2
- 下一篇: 如何区分普通感冒流感和新型冠状病毒肺炎?