G
Guest
hi, ive tried two ways of accessing an FTP server and neither worked. both
threw an error saying "User Not Logged In"....so i have no idea how to do
this....heres the code
My.Computer.Network.UploadFile("FileName", "ftp://name.MyServer.net",
"UserName", "Password")
and
Dim c As New Net.NetworkCredential
Dim snd As Net.FtpWebRequest
c.UserName = Me.txtUser.Text
c.Password = Me.mtxtPass.Text
For Each obj As Object In Me.lstAddedFiles.Items
Dim tmp As String = obj.ToString
Dim state As New FtpState
snd = WebRequest.Create(New Uri(Me.txtWebSite.Text.Trim & "/" &
tmp.Substring(tmp.LastIndexOf("\") + 1)))
snd.Credentials = c
snd.UseBinary = True
snd.Method = Net.WebRequestMethods.Ftp.UploadFile
state.FileName = obj.ToString()
state.snd = snd
snd.BeginGetRequestStream(AddressOf FtpFileUploadCallBack, state)
Next
any help would be great
threw an error saying "User Not Logged In"....so i have no idea how to do
this....heres the code
My.Computer.Network.UploadFile("FileName", "ftp://name.MyServer.net",
"UserName", "Password")
and
Dim c As New Net.NetworkCredential
Dim snd As Net.FtpWebRequest
c.UserName = Me.txtUser.Text
c.Password = Me.mtxtPass.Text
For Each obj As Object In Me.lstAddedFiles.Items
Dim tmp As String = obj.ToString
Dim state As New FtpState
snd = WebRequest.Create(New Uri(Me.txtWebSite.Text.Trim & "/" &
tmp.Substring(tmp.LastIndexOf("\") + 1)))
snd.Credentials = c
snd.UseBinary = True
snd.Method = Net.WebRequestMethods.Ftp.UploadFile
state.FileName = obj.ToString()
state.snd = snd
snd.BeginGetRequestStream(AddressOf FtpFileUploadCallBack, state)
Next
any help would be great