日期:2014-05-18  浏览次数:20969 次

如何将webbrowser 中的内容保存为Excel文件呀?
有一网页,例如格式如下:
http://219.142.101.91/jzqy/result.asp?sqls=select+%2A+from+chinabuild+&pageno=1&pp=下一页

用webbrowser   打开,如何将其保存成Excel文件呀?

请高手帮帮忙,急用

------解决方案--------------------
1.右击选择“导出到MS Excel”
2.选中表格部分,赋值黏贴到Excel
------解决方案--------------------
response.Clear();
response.ContentType = "application/vnd.ms-excel ";
response.AddHeader( "Content-Disposition ", "attachment; filename= " + filename);
response.Charset = "utf-8 ";
response.ContentEncoding = Encoding.UTF8;
StringWriter writer1 = new StringWriter();
HtmlTextWriter writer2 = new HtmlTextWriter(writer1);
grid.RenderControl(writer2);
response.Write(writer1.ToString());
response.End();
------解决方案--------------------
自己写组件?