本文整理汇总了C#中ApplicationClass类的典型用法代码示例。如果您正苦于以下问题:C#ApplicationClass类的具体用法?C#ApplicationClass怎么用?C#ApplicationClass使用的例子?这里精选的类代码示例或许可以为您提供帮助。
示例1:ExportToExcel
publicvoidExportToExcel(DataGridViewgrid,stringr_id,stringtime)
{
ApplicationClassExcel=newApplicationClass();
XlReferenceStyleRefStyle=Excel.ReferenceStyle;
Excel.Visible=true;
Workbookwb=null;
StringTemplatePath=System.Windows.Forms.Application.StartupPath+@"Отчет"+r_id+".xlt";
try
{
wb=Excel.Workbooks.Add(TemplatePath);//!!!
}
catch(System.Exceptionex)
{
thrownewException("Неудалосьзагрузитьшаблондляэкспорта"+TemplatePath+"
"+ex.Message);
}
Worksheetws=wb.Worksheets.get_Item(1)asWorksheet;
ws.Cells[20,3]=time;
for(intj=0;j
原文链接:http://www.jxszl.com/biancheng/C/556553.html