Imports System.Drawing.Imaging, System.Net
Public Shared Function Random(ByVal PasswordLength As Integer) As String Dim _allowedChars As String = "abcdefghijkmnopqrstuvwxyz"
Dim randNum As New Random()
Dim chars(PasswordLength - 1) As Char
Dim allowedCharCount As Integer = _allowedChars.Length
For i As Integer = 0 To PasswordLength - 1
chars(i) = _allowedChars.Chars(CInt(Fix((_allowedChars.Length) * randNum.NextDouble())))
Next i
Return New String(chars)
End Function
Random(number of chars of the string)
Private Function MyCodec() As ImageCodecInfo Dim codecs As ImageCodecInfo() = ImageCodecInfo.GetImageEncoders
For Each codec As ImageCodecInfo In codecs
If (codec.MimeType = "image/jpeg") Then
Return codec
End If
Next
Return Nothing
End Function
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
System.Threading.Thread.Sleep(250)
Dim myEncoder As New EncoderParameters(1)
myEncoder.Param(0) = New EncoderParameter(Encoder.Quality, 1000)
Dim bmp As Bitmap = New Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height)
Dim g As Graphics = Graphics.FromImage(bmp)
g.CopyFromScreen(Screen.PrimaryScreen.Bounds.X, Screen.PrimaryScreen.Bounds.Y, 0, 0, Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy)
g.Dispose()
Dim rand As String = Random(
Dim Path As String = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) & "\" & rand & ".jpg"
bmp.Save(Path, MyCodec, myEncoder)
Dim UploadRequest As System.Net.FtpWebRequest = _
DirectCast(System.Net.WebRequest.Create("ftp://www.screencapture.altervista.org/" [COLOR=#00ff00]& rand & ".jpg"[/COLOR]), System.Net.FtpWebRequest)
UploadRequest.Credentials = New System.Net.NetworkCredential("username", "password")
UploadRequest.Method = System.Net.WebRequestMethods.Ftp.UploadFile
Dim UploadStream As System.IO.Stream = UploadRequest.GetRequestStream()
UploadStream.Write(System.IO.File.ReadAllBytes(Path), 0, System.IO.File.ReadAllBytes(Path).Length)
Clipboard.SetText("www.screencapture.altervista.org/" & rand & ".jpg")
System.IO.File.Delete(Path)
End Sub
Imports System.Drawing.Imaging, System.Net
Public Shared Function Random(ByVal PasswordLength As Integer) As String Dim _allowedChars As String = "abcdefghijkmnopqrstuvwxyz"
Dim randNum As New Random()
Dim chars(PasswordLength - 1) As Char
Dim allowedCharCount As Integer = _allowedChars.Length
For i As Integer = 0 To PasswordLength - 1
chars(i) = _allowedChars.Chars(CInt(Fix((_allowedChars.Length) * randNum.NextDouble())))
Next i
Return New String(chars)
End Function
Random(number of chars of the string)
Private Function MyCodec() As ImageCodecInfo Dim codecs As ImageCodecInfo() = ImageCodecInfo.GetImageEncoders
For Each codec As ImageCodecInfo In codecs
If (codec.MimeType = "image/jpeg") Then
Return codec
End If
Next
Return Nothing
End Function
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
System.Threading.Thread.Sleep(250)
Dim myEncoder As New EncoderParameters(1)
myEncoder.Param(0) = New EncoderParameter(Encoder.Quality, 1000)
Dim bmp As Bitmap = New Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height)
Dim g As Graphics = Graphics.FromImage(bmp)
g.CopyFromScreen(Screen.PrimaryScreen.Bounds.X, Screen.PrimaryScreen.Bounds.Y, 0, 0, Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy)
g.Dispose()
Dim rand As String = Random(
Dim Path As String = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) & "\" & rand & ".jpg"
bmp.Save(Path, MyCodec, myEncoder)
Dim UploadRequest As System.Net.FtpWebRequest = _
DirectCast(System.Net.WebRequest.Create("ftp://www.screencapture.altervista.org/" [COLOR=#00ff00]& rand & ".jpg"[/COLOR]), System.Net.FtpWebRequest)
UploadRequest.Credentials = New System.Net.NetworkCredential("username", "password")
UploadRequest.Method = System.Net.WebRequestMethods.Ftp.UploadFile
Dim UploadStream As System.IO.Stream = UploadRequest.GetRequestStream()
UploadStream.Write(System.IO.File.ReadAllBytes(Path), 0, System.IO.File.ReadAllBytes(Path).Length)
Clipboard.SetText("www.screencapture.altervista.org/" & rand & ".jpg")
System.IO.File.Delete(Path)
End Sub
Copyright © 2026, NextGenUpdate.
All Rights Reserved.