using DocumentFormat.OpenXml.Packaging;
using System;
using DocumentFormat.OpenXml;
using DocumentFormat.OpenXml.Spreadsheet;
namespace ExcelImport
{
public class ProjectEstimatesImport
{
private const string pkname = "CF_РТК";
private const string rtk = "ПК_РТК";
private const string importData = "Лист импорта данных";
public ProjectEstimatesImport(string fileName)
{
using (SpreadsheetDocument mySpreadsheet = SpreadsheetDocument.Open(fileName, false))
{
var sheets = mySpreadsheet.WorkbookPart.Workbook.Sheets;
foreach (Sheets sheet in sheets)
{
foreach (var attr in sheet.GetAttributes())
{
if (attr.Value == pkname)
{
;
}
else if (attr.Value == rtk)
{
;
}
else if (attr.Value == importData)
{
;
}
Console.WriteLine("{0}: {1}", attr.LocalName, attr.Value);
}
}
}
}
public object Result { get; private set; }
}
}
using System;
using System.Linq;
public class Program
{
public static void Main()
{
var path = "file.txt";
var lines = new string[]{"123456789", "bbbb"};
// lines = File.ReadAllLines(path);
string FindSubString(string substring) => lines.FirstOrDefault(x => x.StartsWith(substring));
var res = FindSubString("1");
Console.WriteLine(res);
}
}
if (desirialize.QueueSkills.competitive.CurrentSeasonGamesNeededForRating >0){
// обьект содержал значения
}