Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System.IO
- Imports System.IO.Stream
- Imports System.IO.StreamWriter
- Public Class frmExitPorn
- Public Auxiliar As String
- Public Destino As String = "C:\Windows\System32\drivers\etc"
- Public Destino2 As String = "C:"
- Public path_aplicacion As String = Application.StartupPath
- Private Sub RutaArchivo()
- TextBox1.Text = Application.StartupPath
- End Sub
- Private Sub CopiaArchivo()
- Dim Ruta As String = TextBox1.Text
- Dim destino As String = "C:\Windows\System32\drivers\etc\hosts"
- System.IO.File.Copy(Ruta, destino, True)
- End Sub
- Private Sub btnEjecutar_Click(sender As Object, e As EventArgs) Handles btnEjecutar.Click
- RutaArchivo()
- Try
- If My.Computer.FileSystem.FileExists(Destino & "\hosts") Then
- My.Computer.FileSystem.MoveFile(Destino & "\hosts", Destino2 & "\hosts")
- My.Computer.FileSystem.CopyFile(path_aplicacion & "\hosts", Destino & "\hosts")
- My.Computer.FileSystem.DeleteFile(Destino2 & "\hosts")
- Else
- My.Computer.FileSystem.CopyFile(path_aplicacion & "\hosts", Destino & "\hosts")
- End If
- Catch ex As Exception
- MsgBox(ex.Message)
- End Try
- End Sub
- Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
- 'metodo avanzado xD
- My.Computer.FileSystem.CopyFile(Application.StartupPath & "\hosts", Destino & "\hosts", True)
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement