![]() SwDestruct.WriteLine("del \"" + strName + "\"") ![]() SwDestruct.WriteLine("if exist \"" + strExe + "\"" + SwDestruct.WriteLine("del " + "\"" + strExe + "\"") SwDestruct.WriteLine("attrib \"" + strExe + "\"" + StreamWriter swDestruct = new StreamWriter(strPath) String strExe = new FileInfo(Application.ExecutablePath) Design it as shown in Figure 1.Īdd the necessary Namespaces so that you will be able to do file manipulation.Ĭreate a Sub procedure aptly named SelfDestruct. Open Visual Studio and create either a C# or a Visual Basic.NET Windows Forms application. The object of this program is to demonstrate two different ways in which you can create a self-destruction application. This is quite handy when you are creating an Uninstaller application or must reload your application after it was patched. Have you ever wondered how you can delete a running program? Today, I will show you how to create a program and, whilst the program is running, delete its executable file.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |