我正在使用excellite lib在Silverlight 4中导出excel,它在Windows 7中工作查找,这里的问题是,相同的应用程序导出excel在Windows 8 IE中不起作用,它会抛出一个错误sDialog.OpenFile(),但它在windows 8 chrome中工作正常。
不允许进行文件操作。访问路径''被拒绝
void exportExcel_Click(object sender, RoutedEventArgs e)
{
SaveFileDialog sDialog = new SaveFileDialog();
sDialog.Filter = "Excel Files(*.xls)|*.xls";
if (sDialog.ShowDialog() == true)
{
Workbook workbook = new Workbook();
Worksheet worksheet = new Worksheet("Friends");
// write data in worksheet cells
worksheet.Cells[0, 0] = new Cell("Column1");
worksheet.Cells[0, 1] = new Cell("Column2");
worksheet.Cells[0, 2] = new Cell("Column3");
worksheet.Cells[1, 0] = new Cell("string value");
worksheet.Cells[1, 1] = new Cell(478574.5, "#,###.00");
worksheet.Cells[1, 2] = new Cell(4);
workbook.Worksheets.Add(worksheet);
using (var stream = sDialog.OpenFile())
{
workbook.Save(stream);
}
}
}
Windows 8 IE有这个限制,或者我做错了什么?