📄 findata.fxjconverter.cs
字号:
outputBox.Enabled = false;
treeView1.Enabled = false;
try
{
DzhData dzh = new DzhData();
string[,] x;
string s="";
string sepChar = seperateChar.Text;
for (int i = 0; i < treeView1.Nodes.Count ; i++)
{
if (treeView1.Nodes[i].Nodes.Count > 0)
{
string[,] codes = dzh.GetData("dm", treeView1.Nodes[i].Nodes[0].Text.Split('|')[1]);
foreach (TreeNode node in treeView1.Nodes[i].Nodes)
{
if (node.Checked)
{
status.Text = node.Text.Split('|')[1] + node.Text.Split('|')[2];
status3.Text += DateTime.Now.ToString("HH:mm:ss") + ":开始转换" + status.Text + " \n";
Application.DoEvents();
switch (node.Text.Split('|')[2])
{
case "dm":
StreamWriter swdm = new StreamWriter(descPath.Text + @"\" + node.Text.Split('|')[3], false);
x = dzh.GetFields("dm");
for (int ii = 0; ii < x.GetLength(0); ii++)
{
swdm.Write(x[ii, 0] + "(" + x[ii, 1] + ")" + sepChar);
}
swdm.WriteLine();
x = dzh.GetData("dm", node.Text.Split('|')[1]);
if (dzh.Error == 1 && errorCounts < 10) { status3.Text += DateTime.Now.ToString("HH:mm:ss") + ":" + node.Text.Split('|')[1] + "," + dzh.Msg + (errorCounts == 9 ? "\n ………………" : "") + " \n"; errorCounts++; }
for (int ii = 0; ii < x.GetLength(0); ii++)
{
status2.Text = x[ii, 0];
Application.DoEvents();
if (stopConverting) { swdm.Close(); return; }
for (int jj = 0; jj < x.GetLength(1); jj++)
{
swdm.Write(x[ii, jj] + sepChar);
}
swdm.WriteLine();
}
swdm.Close();
status3.Text += DateTime.Now.ToString("HH:mm:ss") + ":生成" + node.Text.Split('|')[3] + " \n";
break;
case "bk":
case "pj":
StreamWriter sw0 = new StreamWriter(descPath.Text + @"\" + node.Text.Split('|')[3], false);
x = dzh.GetFields(node.Text.Split('|')[2]);
for (int ii = 0; ii < x.GetLength(0); ii++)
{
sw0.Write(x[ii, 0] + "(" + x[ii, 1] + ")" + sepChar);
}
sw0.WriteLine();
x = dzh.GetData(node.Text.Split('|')[2], "");
if (dzh.Error == 1 && errorCounts < 10) { status3.Text += DateTime.Now.ToString("HH:mm:ss") + ":" + node.Text.Split('|')[2] + "," + dzh.Msg + (errorCounts == 9 ? "\n ………………" : "") + " \n"; errorCounts++; }
for (int ii = 0; ii < x.GetLength(0); ii++)
{
status2.Text = x[ii, 0];
Application.DoEvents();
if (stopConverting) { sw0.Close(); return; }
for (int jj = 0; jj < x.GetLength(1); jj++)
{
sw0.Write(x[ii, jj] + sepChar);
}
sw0.WriteLine();
}
sw0.Close();
status3.Text += DateTime.Now.ToString("HH:mm:ss") + ":生成" + node.Text.Split('|')[3] + " \n";
break;
default:
StreamWriter sw = new StreamWriter(descPath.Text + @"\" + node.Text.Split('|')[3], false);
x = dzh.GetFields(node.Text.Split('|')[2]);
for (int ii = 0; ii < x.GetLength(0); ii++)
{
sw.Write(x[ii, 0] + "(" + x[ii, 1] + ")" + sepChar);
}
sw.WriteLine();
for (int c = 0; c < codes.GetLength(0); c++)
{
if (dzh.GetCodeType(codes[c, 0]) != "")
{
status2.Text = codes[c, 0];
Application.DoEvents();
x = dzh.GetData(node.Text.Split('|')[2], codes[c, 0], node.Text.Split('|')[4]);
if (dzh.Error == 1 && errorCounts < 10) { status3.Text += DateTime.Now.ToString("HH:mm:ss") + ":" + codes[c, 0] + "," + dzh.Msg + (errorCounts==9?"\n ………………":"") + " \n"; errorCounts++; }
for (int ii = 0; ii < x.GetLength(0); ii++)
{
if (stopConverting) { sw.Close(); return; }
s = "";
for (int jj = 0; jj < x.GetLength(1); jj++)
{
s += x[ii, jj] + sepChar;
}
sw.WriteLine(s);
}
}
}
status3.Text += DateTime.Now.ToString("HH:mm:ss") + ":生成" + node.Text.Split('|')[3] + " \n";
sw.Close();
break;
}
}
}
}
}
}//try
catch (Exception ex)
{
status3.Text += "发生错误:" + ex.Message+"\n";
}
finally
{
button1.Text = "转换(&T)";
stopConverting = false;
outputBox.Enabled = true;
treeView1.Enabled = true;
status3.Text += DateTime.Now.ToString("HH:mm:ss") + ":转换结束.\n";
}
}
private void browseFolder_Click(object sender, EventArgs e)
{
folderBrowserDialog1.SelectedPath = descPath.Text;
folderBrowserDialog1.ShowDialog();
descPath.Text = folderBrowserDialog1.SelectedPath;
}
private void url_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
System.Diagnostics.Process process = new System.Diagnostics.Process();
process.StartInfo.FileName = "iexplore.exe";
process.StartInfo.Arguments = "http://www.sasfans.com/";
process.Start();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -