1
我使用LinqToExcel來讀取Excel文件。一切工作正常,但它的單元格的內容是一個超鏈接,我只得到超鏈接文本。我想獲得它的網址/電子郵件。LinqToExcel獲取超鏈接值
try
{
// Connection to the DB
iRentDB db = new iRentDB();
// Get excel file and work sheet
string pathToExcelFile = @"Members_Export_1500068180.xls";
string sheetName = "Members_Export_1500068180";
var excelFile = new LinqToExcel.ExcelQueryFactory(pathToExcelFile);
// Select all rows from Excel
var rows = from c in excelFile.WorksheetNoHeader(sheetName)
select c;
foreach (var row in rows)
{
// Get and validate the email
var email = row[8].Value.ToString();
}
}catch (Exception any)
{
Console.Write(any.ToString());
}
我正在閱讀的單元格是一個超鏈接。單元格內容名稱爲「電子郵件」,超鏈接值爲[email protected]。 在我的C#代碼中,變量email =「Email」。如何設置可變電子郵件的超鏈接值(「[email protected]」)?
感謝