io.kent Posted June 17, 2013 Report Posted June 17, 2013 mod de autentificare folosind HttpWebrequest.... TextboxsTextbox1 for UserNameTextbox2 For Password (put the PasswordChar to systemDefault)Button for LoginOur Imports :Imports System.Net Imports System.Text Imports System.IOIn the Public Class Form Add This CodeDim logincookie As CookieContainer Click the Button and Add this Code : Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim postData As String = "http%3A%2F%2Feliteguys.org%2Fforum%2Fmember.php?action=login&username=" + TextBox1.Text & "&password=" + TextBox2.Text & "&submit=Login&action=do_login&url=" Dim tempcookies As New CookieContainer Dim encoding As New UTF8Encoding Dim byteData As Byte() = encoding.GetBytes(postData) Dim postreq As HttpWebRequest = DirectCast(HttpWebRequest.Create("http://eliteguys.org/member.php?&action=login"), HttpWebRequest) postreq.Method = "POST" postreq.KeepAlive = True postreq.CookieContainer = tempcookies postreq.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2.3) Gecko/20100401 Firefox/4.0 (.NET CLR 3.5.30729" postreq.ContentType = "application/x-www-form-urlencoded" postreq.Referer = "http://eliteguys.org/member.php?&action=login" postreq.ContentLength = byteData.Length Dim postreqstream As Stream = postreq.GetRequestStream() postreqstream.Write(byteData, 0, byteData.Length) postreqstream.Close() Dim postresponse As HttpWebResponse postresponse = DirectCast(postreq.GetResponse, HttpWebResponse) tempcookies.Add(postresponse.Cookies) logincookie = tempcookies Dim postreqreader As New StreamReader(postresponse.GetResponseStream()) Dim thepage As String = postreqreader.ReadToEnd If thepage.Contains("You have entered an invalid username/password combination.") = True Then MsgBox("Incorrect Username/password combination", 0, "Login error!") Else MsgBox("Logged in", 0, "Success!") End If End Sub End Class Quote