ex handling
This commit is contained in:
parent
7e71c99a84
commit
609eccd75b
@ -30,6 +30,8 @@ namespace OWTrack
|
||||
}
|
||||
|
||||
private void checkStatus()
|
||||
{
|
||||
try
|
||||
{
|
||||
Time.Text = DateTime.Now.ToString("h:mm tt");
|
||||
if (tr.owRunning())
|
||||
@ -43,6 +45,11 @@ namespace OWTrack
|
||||
status.ForeColor = Color.Red;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
MessageBox.Show(e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
@ -17,11 +17,19 @@ namespace OWTrack
|
||||
}
|
||||
|
||||
public bool owRunning()
|
||||
{
|
||||
try
|
||||
{
|
||||
bool isRunning = Process.GetProcessesByName("Overwatch")
|
||||
.FirstOrDefault(p => p.MainModule.FileName.StartsWith(@"D:\Hesham\installed Games\Overwatch")) != default(Process);
|
||||
return isRunning;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Exception ex = new Exception("Error in tracking Overwatch.exe");
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
public void addWin() { wins++; }
|
||||
public void addLoss() { losses++; }
|
||||
|
Loading…
Reference in New Issue
Block a user