Explorar el Código

Excel导出,string字段中的\跟“” 需要转义

tanghai hace 3 años
padre
commit
58384c8fa3
Se han modificado 1 ficheros con 2 adiciones y 0 borrados
  1. 2 0
      Share/Tool/ExcelExporter/ExcelExporter.cs

+ 2 - 0
Share/Tool/ExcelExporter/ExcelExporter.cs

@@ -564,6 +564,8 @@ namespace ET
 
                     return value;
                 case "string":
+                    value = value.Replace("\\", "\\\\");
+                    value = value.Replace("\"", "\\\"");
                     return $"\"{value}\"";
                 default:
                     throw new Exception($"不支持此类型: {type}");