我有使用savefiledialog將網格視圖保存爲html文件的代碼。我想將它保存到一個特定的路徑(不使用savefiledialog)...我該怎麼做?將文件保存到特定路徑
這裏是我的代碼:
SaveFileDialog dialog = new SaveFileDialog();
dialog.DefaultExt = "*.html";
dialog.Filter = "WORD Document (*.html)|*.html";
if (dialog.ShowDialog() == true)
{
RadDocument document = CreateDocument(rgvReportData);
document.LayoutMode = DocumentLayoutMode.Paged;
document.Measure(RadDocument.MAX_DOCUMENT_SIZE);
document.Arrange(new RectangleF(PointF.Empty, document.DesiredSize));
document.SectionDefaultPageMargin = new Telerik.Windows.Documents.Layout.Padding(2, 2, 2, 2);
document.SectionDefaultPageOrientation = PageOrientation.Landscape;
HtmlFormatProvider provider = new HtmlFormatProvider();
using (Stream output = dialog.OpenFile())
{
provider.Export(document, output);
}
}
我怎麼能SVE它不使用savefiledialog?
這是什麼語言? – 2011-05-20 02:38:53
這是C#。重新標記。 – Ryan 2011-05-20 02:40:09