initial commit
This commit is contained in:
144
Cs_HMI/Project/Dialog/fSystem.cs
Normal file
144
Cs_HMI/Project/Dialog/fSystem.cs
Normal file
@@ -0,0 +1,144 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Project.Dialog
|
||||
{
|
||||
public partial class fSystem : Form
|
||||
{
|
||||
public bool shutdown = false;
|
||||
public fSystem()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
Util.RunProcess(@"c:\windows\system32\shutdown.exe", "-r -t 5");
|
||||
}
|
||||
|
||||
private void button2_Click(object sender, EventArgs e)
|
||||
{
|
||||
Util.RunProcess(@"c:\windows\system32\shutdown.exe", "-s -t 5");
|
||||
}
|
||||
|
||||
private void button3_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void tableLayoutPanel1_Paint(object sender, PaintEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void lbMsg_Click(object sender, EventArgs e)
|
||||
{
|
||||
string path = AppDomain.CurrentDomain.BaseDirectory;
|
||||
System.Diagnostics.Process prc = new System.Diagnostics.Process();
|
||||
System.Diagnostics.ProcessStartInfo si = new System.Diagnostics.ProcessStartInfo("explorer")
|
||||
{
|
||||
Arguments = path
|
||||
};
|
||||
prc.StartInfo = si;
|
||||
prc.Start();
|
||||
}
|
||||
|
||||
private void arLabel1_Click(object sender, EventArgs e)
|
||||
{
|
||||
SendKeys.Send("^{ESC}");
|
||||
}
|
||||
|
||||
private void arLabel6_Click(object sender, EventArgs e)
|
||||
{
|
||||
SendKeys.Send("^+{ESC}");
|
||||
}
|
||||
|
||||
private void arLabel9_Click(object sender, EventArgs e)
|
||||
{
|
||||
shutdown = true;
|
||||
Util.SystemShutdown(10);
|
||||
this.Close();
|
||||
|
||||
}
|
||||
|
||||
private void arLabel10_Click(object sender, EventArgs e)
|
||||
{
|
||||
shutdown = true;
|
||||
Util.SystemReboot(10);
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void arLabel4_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void arLabel2_Click(object sender, EventArgs e)
|
||||
{
|
||||
System.Text.StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.AppendLine("Current : " + System.Diagnostics.Process.GetCurrentProcess().ProcessName);
|
||||
|
||||
foreach (var prc in System.Diagnostics.Process.GetProcesses())
|
||||
{
|
||||
if (prc.ProcessName.StartsWith("svchost")) continue;
|
||||
sb.Append(" " + prc.ProcessName);
|
||||
}
|
||||
Util.MsgI(sb.ToString(),true);
|
||||
}
|
||||
|
||||
private void fSystem_Load(object sender, EventArgs e)
|
||||
{
|
||||
this.label1.Text = "Patch Version " + PUB.PatchVersion;
|
||||
this.label2.Text = "HMI Version " + Application.ProductVersion.ToString();
|
||||
}
|
||||
|
||||
private void arLabel3_Click(object sender, EventArgs e)
|
||||
{
|
||||
var file = System.IO.Path.Combine( Util.CurrentPath, "Emulator.exe");
|
||||
if(System.IO.File.Exists(file)==false)
|
||||
{
|
||||
Util.MsgE("에물레이터 실행 파일이 없습니다", true);
|
||||
return;
|
||||
}
|
||||
|
||||
Util.RunProcess(file);
|
||||
}
|
||||
|
||||
private void arLabel5_Click(object sender, EventArgs e)
|
||||
{
|
||||
//현재 폴더에서 dll 과, amkor.exe 파일을 압축한다
|
||||
var path = new System.IO.DirectoryInfo( AppDomain.CurrentDomain.BaseDirectory);
|
||||
var files_dll = path.GetFiles("*.dll");
|
||||
var file_exe = System.IO.Path.Combine(path.FullName, "amkor.exe");
|
||||
if(System.IO.File.Exists(file_exe)==false)
|
||||
{
|
||||
Util.MsgE("실행파일 amkor.exe 가 없습니다.");
|
||||
return;
|
||||
}
|
||||
var zipfile = new Ionic.Zip.ZipFile();
|
||||
zipfile.AddFile(file_exe,"/");
|
||||
foreach (var filedll in files_dll)
|
||||
zipfile.AddFile(filedll.FullName,"/");
|
||||
|
||||
var veri = Application.ProductVersion.Split('.');
|
||||
var newfilename = "Patch_AGV_" + veri[0] + veri[1]+ veri[2] + "_" +
|
||||
veri[3] + ".zip";
|
||||
zipfile.Save(newfilename);
|
||||
|
||||
Util.MsgI("다음 패치 파일이 생성됨\n" + newfilename);
|
||||
}
|
||||
|
||||
private void arLabel7_Click(object sender, EventArgs e)
|
||||
{
|
||||
Util.SystemReboot(5,true);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user