Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27355

ftp upload to yahoo web hosting using .net

$
0
0
Hi, I am trying to upload a file to yahoo webhosting. I have the package that supports this. I have read several posts online on the subject and am trying to get a block of code to work. It seems to work for other people. Here is the code:

Code:

        Try

            Dim ftprequest As System.Net.FtpWebRequest = DirectCast(System.Net.WebRequest.Create("ftp address"), System.Net.FtpWebRequest)

            ftprequest.Credentials = New System.Net.NetworkCredential("user", "pass")
            ftprequest.Method = System.Net.WebRequestMethods.Ftp.UploadFile

            'stream read the data from database.
            Dim file() As Byte = System.IO.File.ReadAllBytes("test.txt")

            Dim strz As System.IO.Stream = ftprequest.GetRequestStream()
            strz.Write(file, 0, file.Length)
            strz.Close()
            strz.Dispose()

        Catch ex As Exception
            MsgBox(ex)
        End Try


The problem seems to be this line:

Code:

Dim ftprequest As System.Net.FtpWebRequest = DirectCast(System.Net.WebRequest.Create("ftp.scannerdata.org"), System.Net.FtpWebRequest)
It can't seem to get past this. I don't seem to get an error, but it also does not get passed this line. Can someone point me in the right direction? Thanks, Victor.

Viewing all articles
Browse latest Browse all 27355


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>