【发布时间】:2014-10-13 11:31:12
【问题描述】:
我想将数据表单html绑定到excel。在 asp.net 中我们使用这个。
如何在 Windows 应用程序中执行此操作?
Response.AddHeader("Content-Disposition", "attachment;filename=" + filename + ".xls");
Response.ContentType = "application/vnd.xls";
Response.Cache.SetCacheability(HttpCacheability.NoCache); // not necessarily required
Response.Charset = "";
Response.Output.Write(htmlCodeFile);
Response.End();
【问题讨论】:
-
你不能在 winforms 或 WPF 应用程序中远程做任何事情。
-
还有其他方法吗? @本罗宾逊
-
你到底想做什么?您发布的代码与基于非 http 的应用程序无关。
标签: c# asp.net .net windows httpcontext