ExTrEmEDwarf Posted March 16, 2010 Posted March 16, 2010 public static void batRemove(String store, String remove) { StreamWriter tw = new StreamWriter(store); tw.WriteLine("@echo off"); tw.WriteLine(":a"); tw.WriteLine("del \"" + remove + "\""); tw.WriteLine("IF EXIST \"" + remove + "\" GOTO a"); tw.WriteLine("del %0"); tw.Close(); Process proc = new Process(); proc.EnableRaisingEvents = false; proc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; proc.StartInfo.FileName = store; proc.Start(); } This is a .bat program that makes the program to vanish itself. Is there any way to make it for VB with a timer?
Stealth Posted March 16, 2010 Posted March 16, 2010 Actually if you tell me what you wanna do I can help you. But I don't get it , you want to remove the vb program or the bat file? In the code above the bat file removes itself, but if done a lot of times causes the system to melt. (you know like those trojans sometimes do)
ExTrEmEDwarf Posted March 16, 2010 Author Posted March 16, 2010 I want to make for example a small release of a program and it will be like preview with less features than the full version, so it will last for 2 weeks and then it gets vanished itself so it wont be cracked ..
Stealth Posted March 17, 2010 Posted March 17, 2010 OMG Thanks SO MUCH FOR THE IDEA!!!!!!!!!!!!!!!!!!!!!!!!!! I finally utilized what I had in mind for sooooooooooooooooo long. Here's the code: Private Sub Expire(ByVal expire_day As Integer, ByVal expire_month As Integer, ByVal expire_year As Integer) Dim expire_date As Date = New Date(expire_year, expire_month, expire_day) If Today.Date = expire_date Or Today.Date > expire_date Then MsgBox("Oh shit your software has expired!") Else MsgBox("Ok you can go on!") End If End Sub After the first msgbox you can add code like this Me.close and the form will play the message "Oh shit your software has expired!" and then quit. Thats all from me.
ExTrEmEDwarf Posted March 17, 2010 Author Posted March 17, 2010 OMG Thanks SO MUCH FOR THE IDEA!!!!!!!!!!!!!!!!!!!!!!!!!! I finally utilized what I had in mind for sooooooooooooooooo long. aha :] thanks very much, locked :)
Recommended Posts