Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/excel/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
NPOI C#SetCellValue()是布尔类型,通过变量作为字符串_C#_Excel_Npoi - Fatal编程技术网

NPOI C#SetCellValue()是布尔类型,通过变量作为字符串

NPOI C#SetCellValue()是布尔类型,通过变量作为字符串,c#,excel,npoi,C#,Excel,Npoi,我想通过变量将布尔类型的CellValue()设置为字符串,例如: 字符串参数=“TRUE” 现在我想设置CellValue(参数) 从上面的字符串值将单元格值设置为布尔类型的正确方法是什么 您可以使用bool.Parse(字符串值) string parameter = "TRUE"; SetCellValue(bool.Parse(parameter));

我想通过变量将布尔类型的CellValue()设置为字符串,例如:

字符串参数=“TRUE”

现在我想设置CellValue(参数)

从上面的字符串值将单元格值设置为布尔类型的正确方法是什么


您可以使用
bool.Parse(字符串值)

string parameter = "TRUE";

SetCellValue(bool.Parse(parameter));