Commonly I use it for logging, and the format is:
DateTime.Now.ToString("yyyyMMdd HH:mm:ss:FFFFFF")
, which results in:20110830 08:22:26:160586The full list is available here (MSDN)
DateTime.Now.ToString("yyyyMMdd HH:mm:ss:FFFFFF")
, which results in:20110830 08:22:26:160586The full list is available here (MSDN)
22/08/2011 10:34:54:293 Sending 'DisplayMessageRequest' request (33 bytes):And here's a way to to this:01 00 1D D2 01 00 01 18 09 00 09 0D 09 50 6C 65 ...?.........Ple 61 73 65 20 53 69 67 6E 20 52 65 63 65 69 70 74 ase Sign Receipt 93 ?
public static bool IsAppAlreadyRunning() { Process currentProcess = Process.GetCurrentProcess(); return Process.GetProcessesByName(currentProcess.ProcessName).Length > 1; }Now obviously, this will find a running instance in a different TS session too - not what we want.
/// <summary> /// Detect if app is running through a remote session, like terminal-services /// </summary> public static bool IsRemoteSession() { return System.Windows.Forms.SystemInformation.TerminalServerSession; // TODO: Citrix check }OK, I'm trying to get the code-formatting working in Blogspot. This will have to do for now!