原件存檔 Original files吳哲宇 Che-Yu Wu

國一下(2008 年 2 月)Grade 7, second term (February 2008)

19530 號殺手與偵測器:一個惡作劇程式和它的解藥The 19530 killer and its detector: a prank program and its antidote

資料夾叫 vbtry,是他自學 Visual Basic 的練習本。殺手和偵測器是兩個各自獨立的專案,檔案日期是 2008 年 2 月 28 日和 29 日,那學期是國一下。這一頁只放說明和程式碼,不放可以執行的檔案。

殺手是一個小視窗,標題叫「no」,裡面只有一顆寫著「來按我」的按鈕。兩個計時器(間隔都設成 1 毫秒)讓按鈕每次移動 2 個像素,先往下到底,再往上到頂,一直在視窗的整個高度來回跑,很難按到。

按到以後,先跳出一個對話框,寫著「小心ㄛ」和兩個驚嘆號,接著在 C:\Program Files 底下建一個叫 microcoft 的資料夾和它的 bin 子資料夾。第三個計時器每次觸發就寫一個小文字檔(0.txt、1.txt……),內容是當下的時間,它的間隔從 101 毫秒開始每次減 2,最後減到 1 毫秒,所以越寫越快。另一個視窗同時顯示「你的剩餘資本」加上 C 槽剩下的位元組數。

The folder is called vbtry, his practice book for teaching himself Visual Basic. The killer and the detector are two separate projects, dated 28 and 29 February 2008, in the second term of seventh grade. This page carries the description and the code only, no files that can be run.

The killer is a small window titled "no" with a single button that says "來按我" (come press me). Two timers, both set to 1 millisecond, move the button 2 pixels at a time, down to the bottom and back up to the top, so it keeps running over the whole height of the window and is hard to hit.

Once it is hit, a dialog says "小心ㄛ!!" (careful!!), and the program creates a folder called microcoft with a bin folder inside it under C:\Program Files. A third timer writes one small text file each time it fires (0.txt, 1.txt and so on) holding the current time. Its interval starts at 101 milliseconds and drops by 2 each time, down to 1, so the files come faster and faster. A second window shows "你的剩餘資本" (your remaining capital) followed by the number of bytes left on drive C.

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        If Button1.Top > 229 Then
            Timer2.Start()
            Timer1.Stop()
        End If
        Button1.Top += 2
    End Sub

    Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
        If Button1.Top < 0 Then
            Timer2.Stop()
            Timer1.Start()
        End If
        Button1.Top -= 2
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        MsgBox("小心ㄛ!!")
        If My.Computer.FileSystem.DirectoryExists("C:\Program Files\microcoft") = False Then
            My.Computer.FileSystem.CreateDirectory("C:\Program Files\microcoft")
            My.Computer.FileSystem.CreateDirectory("C:\Program Files\microcoft\bin")
        End If
        Timer3.Start()
        Form2.Show()
        Me.Hide()
    End Sub

    Private Sub Timer3_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer3.Tick
        If Timer3.Interval > 2 Then
            Timer3.Interval -= 2
        End If
        My.Computer.FileSystem.WriteAllText("C:\Program Files\microcoft\bin\" + num.ToString + ".txt", Now.TimeOfDay.ToString, False)
        num += 1
    End Sub
殺手的 Form1.vb:按鈕上下跑、按下去之後的動作,和寫檔的計時器。原檔是 Big5 編碼,這裡轉成 UTF-8。The killer's Form1.vb: the running button, what happens on a click, and the file-writing timer. The original is Big5-encoded; it is shown here as UTF-8.

偵測器也是一個小視窗,標題「19530號殺手偵測」。按「偵測」會顯示 C 槽剩餘空間,按鈕的文字變成「如果數值不斷減少,你重了19530號殺手」(原文寫「重了」)。如果 microcoft\bin 資料夾存在,它會替你打開這個資料夾,並啟用第二顆按鈕「漸進刪除」。按下去以後,一個計時器從 1.txt 開始一個一個刪檔案,計數從 1 起算,所以 0.txt 不會被刪到。

19530 這個數字代表什麼,檔案裡沒有說明。資料夾裡還留著殺手的 7 個發佈版本(1.0.0.0 到 1.0.0.6)和偵測器的 4 個發佈版本,發佈日期同樣是 2008 年 2 月 28 日和 29 日。

The detector is also a small window, titled "19530號殺手偵測" (19530 killer detector). The "偵測" (detect) button shows the free space on drive C, and its caption changes to "如果數值不斷減少,你重了19530號殺手" (if the number keeps falling, you caught the 19530 killer; the original writes 重了 where 中了 is meant). If the microcoft\bin folder exists it opens the folder for you and enables a second button, "漸進刪除" (delete gradually). After that a timer deletes the files one by one starting from 1.txt. The count starts at 1, so 0.txt is never deleted.

The files do not say what 19530 stands for. The folder also keeps 7 published versions of the killer (1.0.0.0 to 1.0.0.6) and 4 of the detector, dated 28 and 29 February 2008 as well.

    Dim num As Integer = 1
    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Label1.Text = "你的剩餘資本" + My.Computer.FileSystem.GetDriveInfo("c").TotalFreeSpace.ToString + " Byte"
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Button1.Text = "如果數值不斷減少,你重了19530號殺手"
        If My.Computer.FileSystem.DirectoryExists("C:\Program Files\microcoft\bin") = True Then
            Process.Start("C:\Program Files\microcoft\bin")
            Button2.Enabled = True
        End If
        Timer1.Start()
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Timer2.Start()
    End Sub

    Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
        My.Computer.FileSystem.DeleteFile("C:\Program Files\microcoft\bin\" + num.ToString + ".txt")
        num += 1
    End Sub
End Class
偵測器的 Form1.vb:顯示剩餘空間、打開資料夾、一個一個刪檔案。The detector's Form1.vb: show the free space, open the folder, delete the files one by one.