-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathLogger.cs
More file actions
29 lines (26 loc) · 713 Bytes
/
Copy pathLogger.cs
File metadata and controls
29 lines (26 loc) · 713 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using System;
using System.Windows.Forms;
namespace MouseSimulator
{
class Logger
{
public void write(TextBox tv, String message)
{
tv.AppendText(getEscapeCharacter(tv) + getTime() + message);
}
private String getTime()
{
return "[" + DateTime.Now.Hour.ToString() + ":" + DateTime.Now.Minute.ToString() + ":" + DateTime.Now.Second.ToString() + "] ";
}
private String getEscapeCharacter(TextBox tv)
{
switch (tv.Text)
{
case "":
return "";
default:
return System.Environment.NewLine;
}
}
}
}