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:
The problem seems to be this line:
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.
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)