1

Visual Basic 2008/2010 - Save Page As, create a Folder, upload the folder to a specific ftp site


I am working on this vb app that will goto a specific site, click on a button(i am still working on the button process) do a save page as, create a folder, save those files to a folder and then upload that folder to a ftp site.

please help, i just need the save as page.....and if you know the solution for click on the login button

Thank you

Button to launch Website

WebBrowser1.Navigate(TextBox1.Text)

Button to login but its not working (still working on this)

Dim MyElementsWeb As HtmlElementCollection = WebBrowser1.Document.All
        For Each LogBtn As HtmlElement In MyElementsWeb
            If LogBtn.GetAttribute("name") = "Login" Then
                LogBtn.InvokeMember("submit")
            End If
        Next

Button to Create folder

My.Computer.FileSystem.CreateDirectory("C:\" + TextBox2.Text)

Button to launch ftp upload

Dim Request as systemnet.ftpwebrequest = directcast(systemnet.webrequest.create("ftp://ftpmysite.com/file.zip"), systemnet.ftpwebrequest)
request.credentials = new system.net.networkcredential("user", "password")
request.method = system.net.webrequestmethods.ftp.uploadfiles

dim files() as byte = system.IO.file.readallbytes("c:\files.zip")

Dim strz as system.io.stream = request.getrequeststream()
strz.write(file, 0, file.length)
strz.close()
strz.dispose()

please help

Edited by jd2369: n/a

2
Contributors
2
Replies
4
Views
5 Years
Discussion Span
Last Post by jd2369
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.