.net核心2.2框架剪贴板上的工作不可用,因为system.window.form不可用于Nuget包。我需要了解如何复制剪贴板中的单元格值,然后将所有单元格值复制到UI。
static void ReadExcelFile(IWebdriver driver)
{
using (SpreadsheetDocument spreadsheetDocument = SpreadsheetDocument.Open("C:\\Test\\WorkFlow.xlsx", false))
{
WorkbookPart workbookPart = spreadsheetDocument.WorkbookPart;
WorksheetPart worksheetPart = workbookPart.WorksheetParts.First();
SheetData sheetData = worksheetPart.Worksheet.Elements<SheetData>().First();
string text;
foreach (Row r in sheetData.Elements<Row>())
{
foreach (Cell c in r.Elements<Cell>())
{
text = c.CellValue.Text;
}
}
Console.WriteLine();
Console.ReadKey();
}
}