//i m using VS 2008, dll as Microsoft.Office.Interop.Excel
//sample code..
Excel.Application xlApp;
Excel.Workbook xlWorkBook;
Excel.Worksheet xlWorkSheet;
object misValue = System.Reflection.Missing.Value;
xlApp = new Excel.ApplicationClass();
xlWorkBook = xlApp.Workbooks.Add(misValue);//create new work book
xlWorkSheet = (Excel.Worksheet)xlWorkBook.Worksheets.get_Item(1);
//CREATING ONE Rectangle shape
xlWorkSheet.Shapes.AddShape(MsoAutoShapeType.msoShapeRectangle, 47, 24, 500, 90);
Microsoft.Office.Interop.Excel.Shape[] myShapes = new Microsoft.Office.Interop.Excel.Shape[1];
//adding textbox
myShapes[0] = xlWorkSheet.Shapes.AddTextbox(MsoTextOrientation.msoTextOrientationHorizontal, 75, 60, 70, 30);
myShapes[0].TextFrame.Characters(misValue, misValue).Text = "Tracking";
浏览器/下载荷选项。
context.Response.ContentType = "application/vnd.ms-excel";
context.Response.AddHeader("Content-Disposition", "attachment; filename= report.xls");
/ 使用临时文本文档的im。 但无需使用临时档案。
string file = context.Server.MapPath("new.txt");
Byte[] myByte = File.ReadAllBytes(file);
context.Response.Clear();
context.Response.BinaryWrite(myByte);
context.Response.Flush();
context.Response.Close();
我们能否利用Ipersiststream界面来挽救记忆流中的物体?