Code: Select all
Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Finalize() End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim tooltip As New ToolTip() tooltip.SetToolTip(Button1, "Click Here to patch you host") Dim Texto As String Texto = "127.0.0.1 l2auth.lineage2.com" & vbNewLine & _ "127.0.0.1 l2testauth.lineage2.com" & vbNewLine & _ "216.107.250.194 nprotect.lineage2.com" & vbNewLine & _ "216.107.250.194 update.nProtect.com" & vbNewLine & _ "216.107.250.194 update.nProtect.net" & vbNewLine My.Computer.FileSystem.WriteAllText("C:\WINDOWS\system32\drivers\etc\HOSTS", Texto, True) MsgBox("Hosts Pathed") End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Dim tooltip As New ToolTip() tooltip.SetToolTip(Button2, "Click here to run the Lineage II Game") Shell("system\L2.exe", 1) Finalize() End Sub Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click Dim tooltip As New ToolTip() tooltip.SetToolTip(Button5, "Click here if your hosts are alredy edited and you want to repatch them") My.Computer.FileSystem.DeleteFile("C:\WINDOWS\system32\drivers\etc\HOSTS", FileIO.UIOption.OnlyErrorDialogs, FileIO.RecycleOption.DeletePermanently) My.Computer.FileSystem.WriteAllText("C:\WINDOWS\system32\drivers\etc\HOSTS", String.Empty, False) Dim Texto As String Texto = "127.0.0.1 localhost" & vbNewLine & _ "127.0.0.1 l2auth.lineage2.com" & vbNewLine & _ "127.0.0.1 l2testauth.lineage2.com" & vbNewLine & _ "216.107.250.194 nprotect.lineage2.com" & vbNewLine & _ "216.107.250.194 update.nProtect.com" & vbNewLine & _ "216.107.250.194 update.nProtect.net" & vbNewLine My.Computer.FileSystem.WriteAllText("C:\WINDOWS\system32\drivers\etc\HOSTS", Texto, True) MsgBox("Hosts Resets. You are now able to play L2 Dodge") End Sub Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click My.Computer.FileSystem.RenameFile("C:\WINDOWS\system32\drivers\etc\HOSTS", "HOSTS_BACK_UP") MsgBox("A security copy of your current hosts has been done") End Sub Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click My.Computer.FileSystem.DeleteFile("C:\WINDOWS\system32\drivers\etc\HOSTS", FileIO.UIOption.OnlyErrorDialogs, FileIO.RecycleOption.SendToRecycleBin) My.Computer.FileSystem.RenameFile("C:\WINDOWS\system32\drivers\etc\HOSTS_BACK_UP", "HOSTS") MsgBox("Your old hosts has been restored") End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click My.Computer.Network.DownloadFile _ ("http://yourip/dns.here/pathto/HOSTS", _ "C:\WINDOWS\system32\drivers\etc\") MsgBox("Your Hosts has been updated") End SubEnd Class