Objective
self-deletion: as the name implies, this program function is very simple, is to implement the program's self-deletion function.
is not feeling very confused, a program runs on its own, how to shut itself down, and then delete it? By the time you finish your process, you will end up and no longer execute any code. When the program executes, the file is open, and it cannot be deleted. is not to think, ah, can not think of the right.
If you can't figure it out, look for the mirror.
implementation principle
The program creates a batch file, and create the process execution, and then the program ends the process, the function of the batch is to delay 5 seconds after the deletion of the specified program and then self-delete. In this way, the program self-deletion function is implemented. Small series recommended a learning C language/c++ study Skirt "627, 012, four xxx", whether you are Daniel or small white, is to change careers or want to join the study together to learn about progress together! The skirt has the development tool, many dry goods and the technical information to share!
Is it very simple, I'll bring you to realize it
Test case
1. Test Case procedure
It's a Hello world.
2. Batch self-deleting files
Code snippet:
All right, that's what this whole thing looks like.
I have a public number, often share some of the C language/c++ technology related dry goods; If you like my share, you can use the search "C language learning Tribe" to focus on
Welcome to join thousands of people to exchange questions and answers skirt: 627+012+464
The C language Restricted area program itself deletes itself? It's time to show the real technology of the self-removal