I'm messing with ftp in visual basic, I got it working good but now I want to be-able to have it read a sql database (that online) which contains user passwords, if one of those passwords are entered then it allows them to upload, if its a wrong password then error message box shows (which I can do that part...).
How would I set that up? I already have the sql sever online and working...just need to connect it to the program and have it check the passwords when the button is clicked. All of which has to be done securely as possible .
Right now I got:
Code:
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
If TextBox12.Text = "Username" And TextBox11.Text = "Password" Then
Dim request As System.Net.FtpWebRequest = DirectCast(System.Net.WebRequest.Create("ftp://ftp.site.org/path" & IO.Path.GetFileName(TextBox10.Text)), System.Net.FtpWebRequest)
request.Credentials = New System.Net.NetworkCredential(TextBox12.Text, TextBox11.Text)
request.Method = System.Net.WebRequestMethods.Ftp.UploadFile
Dim file() As Byte = System.IO.File.ReadAllBytes(TextBox10.Text)
Dim strz As System.IO.Stream = request.GetRequestStream()
strz.Write(file, 0, file.Length)
strz.Close()
strz.Dispose()
Label9.Visible = True
Else
MsgBox("Incorrect Username, Password, or File path not set!", MsgBoxStyle.Critical)
End If
End Sub
+rep +1 thanks
Posts 1–6 of 6 · Page 1 of 1
Post a Reply
Tags for this Thread
None
so you want to read a table content in a SLQ Database? I'm kinda confused, can you please explain better?
In which case marked solved.
No read to post in here unless < 7 days & important.
Originally Posted by mnpeepno2
HOLY SHIT!
Ive been looking for something like this.
Click the thanks next time.
2day ban for spam. Especially considering the post above said
"Marked solved , do not post unless <7 days and important"
The purpose of marking something solved is the same as closing it, however, I chose not to close a solved thread in order to help others who may need help with the same issue.