Monday, November 21, 2011

How To Make Your Application Delete Itself

XP:

Process.Start("cmd.exe", "/C ping 1.1.1.1 -n 1 -w 3000 > Nul & Del " + 
          Application.ExecutablePath); 


none-XP


Process.Start("cmd.exe", 
 "/C choice /C Y /N /D Y /T 3 & Del " + Application.ExecutablePath);
Application.Exit();


reference:
http://www.codeproject.com/KB/threads/HowToDeleteCurrentProcess.aspx

Saturday, November 19, 2011

System.Windows.Forms.Cursor.Hide

http://msdn.microsoft.com/en-us/library/system.windows.forms.cursor.hide.aspx

The Show and Hide method calls must be balanced. For every call to the Hide method there must be a corresponding call to the Show method.

坑爹啊...