Commit 06067e03 贾鹏旭

将导出csv文件的内容全加上“”

1 个父辈 a372778e
...@@ -253,7 +253,7 @@ namespace SmartScan ...@@ -253,7 +253,7 @@ namespace SmartScan
int exportFileFormat = ConfigHelper.Config.Get("ExportFileFormat", 1); int exportFileFormat = ConfigHelper.Config.Get("ExportFileFormat", 1);
private void BtnExport_Click(object sender, EventArgs e) private void BtnExport_Click(object sender, EventArgs e)
{ {
if (LstRecord.SelectedIndex == -1) return; if (LstRecord.SelectedIndex == -1) return;
switch (exportFileFormat) switch (exportFileFormat)
{ {
...@@ -274,16 +274,15 @@ namespace SmartScan ...@@ -274,16 +274,15 @@ namespace SmartScan
List<string> lines = new List<string>(); List<string> lines = new List<string>();
foreach (var item in BLLCommon.macroKey) foreach (var item in BLLCommon.macroKey)
{ {
string value = "";
if (pairs.ContainsKey(item)) if (pairs.ContainsKey(item))
{ {
lines.Add(pairs[item].ToString()); value = pairs[item].ToString();
}
else
{
lines.Add("");
} }
} value = value.Replace("\"\"", "\"\"\"\"");
return string.Join(",", lines); lines.Add("\""+value+"\"");
}
return $"{string.Join(",", lines)}";
} }
string genLine(string txt) string genLine(string txt)
{ {
...@@ -355,7 +354,7 @@ namespace SmartScan ...@@ -355,7 +354,7 @@ namespace SmartScan
content.AppendLine(string.Join(",", BLLCommon.macroKey)); content.AppendLine(string.Join(",", BLLCommon.macroKey));
var path = fileFull[index]; var path = fileFull[index];
{ {
string json = System.IO.File.ReadAllText(path.codePath); string json = System.IO.File.ReadAllText(path.codePath);
System.Web.Script.Serialization.JavaScriptSerializer serializer = new(); System.Web.Script.Serialization.JavaScriptSerializer serializer = new();
Dictionary<string, object> dic = (Dictionary<string, object>)serializer.DeserializeObject(json); Dictionary<string, object> dic = (Dictionary<string, object>)serializer.DeserializeObject(json);
...@@ -437,7 +436,7 @@ namespace SmartScan ...@@ -437,7 +436,7 @@ namespace SmartScan
proes.StartInfo = new ProcessStartInfo proes.StartInfo = new ProcessStartInfo
{ {
FileName = f, FileName = f,
WorkingDirectory = Path.Combine(Environment.CurrentDirectory, "ASTI"), WorkingDirectory = System.IO.Path.Combine(Environment.CurrentDirectory, "ASTI"),
Verb = "runas" // 这里设置为 "runas" 表示以管理员身份运行 Verb = "runas" // 这里设置为 "runas" 表示以管理员身份运行
}; };
proes.StartInfo.UseShellExecute = false; proes.StartInfo.UseShellExecute = false;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!