C# 使用NPOI读取Excel表格中的内容,表格里包括身份证号码,一般身份证号码读取出来都是字符串,现在遇到了末尾4位数都是0的身份证号码,读取出来是科学计数法表示的,请问对于这种特殊的身份证号怎么处理啊
DataRow dataRow = targetTable.NewRow();
//遍历读取数据
for (int columnIndex = 0; columnIndex < currentColumnLength; columnIndex++)
{
//没有数据的单元格默认为空
if (currentRow.GetCell(columnIndex) != null)
{
dataRow[columnIndex] = currentRow.GetCell(columnIndex).ToString();
}
}
//把DataTable的数据行添加到DataTable中
targetTable.Rows.Add(dataRow);
说明excel里面存的就是个这样的字符串,否则如果你读到的是个int型,c#自己不会自动把它转为科学计数法的