PasteSite.Com

Recent Pastes

Sign Up!

PasteSite is open to the public, but with limited features. Register to be able to modify access rights, track your pastes and more...

Change the theme

If you prefer reading light text on a dark background to dark text on a light background, then you might want to try the dark theme.

This paste is a reply. View the Previous Paste?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
    Public Function UploadFile(ByVal Host As String, ByVal Username As String, ByVal Password As String, ByVal Directory As String, ByVal Website As String, ByVal Timeout As Integer, ByVal FilePath As String) As String
        ' Uploads the file.
        My.Computer.Network.UploadFile(FilePath, Host & "/" & Directory & "/" & System.IO.Path.GetFileName(FilePath), Username, Password, True, Timeout, FileIO.UICancelOption.ThrowException)
 
        ' Returns the url.
        Return (Website & "/" & Directory & System.IO.Path.GetFileName(FilePath))
    End Function
 
    ' This function would be used like this.
    UploadFile("ftp://mysite.com/", "User@mysite.com", "Password","Files", "http://mysite.com/",120000,"C:\Users\Creme\File.txt")
 
    ' It would upload to:
    ' ftp://mysite.com/Files/File.txt'
    ' and return the url.
    ' http://mysite.com/files/File.txt
 
So in your case use:
 
Clipboard.SetText(UploadFile("ftp://mysite.com/", "User@mysite.com", "Password","Files", "http://mysite.com/",120000,"C:\Users\Creme\File.txt"))

Reply to This Paste

(leave blank to make this paste permanent)
(if set as private)