点击button按钮后调用以下代码进行文件的下载,实际运行后点击按钮可以调出下载的对确认框,但我想不要出现这个框,而是直接调出另存为这个对话框不知不保实现?即不要让用户在确认框里再点击保存按钮了,直接就另存为??望各位大侠指正!
string  Str_Now = "c:\\"+this.m_ExportFileName;
FileStream myFile = File.OpenRead(Str_Now);
byte[] fileCont = new byte[myFile.Length];
myFile.Read(fileCont,0,(int)myFile.Length);
Page.Response.Clear();
Page.Response.AddHeader( "Content-Type", "application/vnd.ms-excel" );
Page.Response.AddHeader("Content-Disposition", "attachment;filename=" + Str_Now);
Page.Response.AddHeader("Content-Length", myFile.Length.ToString());
Page.Response.ContentType="application/octet-stream";
Page.Response.BinaryWrite(fileCont);
Page.Response.Flush();
Page.Response.End();