|
|
@@ -42,6 +42,7 @@ namespace UAS_MES
|
|
|
Thread TestPrint;
|
|
|
|
|
|
string sysdisc = Environment.GetEnvironmentVariable("windir").Substring(0, 1);
|
|
|
+ string lblpath = Environment.GetEnvironmentVariable("windir").Substring(0, 1) + @":\Log\cacheInfo";
|
|
|
|
|
|
public Main()
|
|
|
{
|
|
|
@@ -82,7 +83,7 @@ namespace UAS_MES
|
|
|
private void Main_Load(object sender, EventArgs e)
|
|
|
{
|
|
|
//杀死全部未关闭的打印进程
|
|
|
- string[] lines = System.IO.File.ReadAllLines(Directory.GetCurrentDirectory() + @"\" + "lblprocess" + ".txt");
|
|
|
+ string[] lines = System.IO.File.ReadAllLines(lblpath + @"\" + "lblprocess" + ".txt");
|
|
|
foreach (string line in lines)
|
|
|
{
|
|
|
if (line != "")
|
|
|
@@ -103,12 +104,12 @@ namespace UAS_MES
|
|
|
catch (Exception)
|
|
|
{
|
|
|
}
|
|
|
- FileStream fs = new FileStream(Directory.GetCurrentDirectory() + @"\" + "lblprocess" + ".txt", FileMode.Open, FileAccess.Read);
|
|
|
+ FileStream fs = new FileStream(lblpath + @"\" + "lblprocess" + ".txt", FileMode.Open, FileAccess.Read);
|
|
|
StreamReader sr = new StreamReader(fs);
|
|
|
String s = sr.ReadToEnd();
|
|
|
sr.Close();
|
|
|
fs.Close();
|
|
|
- FileStream fas = new FileStream(Directory.GetCurrentDirectory() + @"\" + "lblprocess" + ".txt", FileMode.Create, FileAccess.ReadWrite);
|
|
|
+ FileStream fas = new FileStream(lblpath + @"\" + "lblprocess" + ".txt", FileMode.Create, FileAccess.ReadWrite);
|
|
|
StreamWriter sw = new StreamWriter(fas);
|
|
|
sw.Write(s.Replace(line+"\r\n",""));
|
|
|
sw.Flush();
|