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

Recommended Answers

All 2 Replies

no bueno

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.