|
You last visited: Today at 17:28
Advertisement
Visual Basic 2010: Problem with WebSite Login
Discussion on Visual Basic 2010: Problem with WebSite Login within the .NET Languages forum part of the Coders Den category.
11/09/2012, 20:06
|
#16
|
elite*gold: 50
Join Date: Sep 2010
Posts: 846
Received Thanks: 223
|
Quote:
Originally Posted by boxxiebabee
Are you ******* stupid?! You need the ID and not the name.
|
Don't be that harsh, we all were beginners once
@OP:
Maybe if you'd read out the source code and find the particular area of the code.
|
|
|
11/09/2012, 21:46
|
#17
|
elite*gold: 0
Join Date: Mar 2011
Posts: 29
Received Thanks: 3
|
NOOOOOOOOOOOOOOOOOO If you/i usethe id the program give me and error! Test...
And so all button that i analyze haven't also the id...
|
|
|
11/10/2012, 00:41
|
#18
|
elite*gold: 1
Join Date: Jun 2012
Posts: 5,819
Received Thanks: 3,200
|
Code:
Public Function Login(ByVal sEMail As String, ByVal sPassword As String)
Dim Request As HttpWebRequest = CType(WebRequest.Create("https://accounts.google.com/ServiceLoginAuth"), HttpWebRequest)
Request.Method = "GET"
Request.CookieContainer = cookies
Request.ContentType = "application/x-www-form-urlencoded"
Dim sPost As String = "continue=http%3A%2F%2Fwww.google.it%2F&dsh=-2164834841695827798&hl=de&checkedDomains=youtube&checkConnection=youtube%3A365%3A1%2Cyoutube%3A97%3A1%2Cyoutube%3A100%3A1&pstMsg=1&GALX=QLsaUIWE6gg&pstMsg=0&dnConn=&checkConnection=&checkedDomains=youtube&timeStmp=&secTok=&Email=" & sEMail & "&Passwd=" & sPassword & "&signIn=Anmelden&rmShown=1"
Dim req As HttpWebRequest = CType(WebRequest.Create("http://accounts.google.com/ServiceLoginAuth"), HttpWebRequest)
req.Method = "POST"
req.CookieContainer = cookies
req.Host = "accounts.google.com"
req.UserAgent = "Mozilla/5.0 (Windows NT 6.2; WOW64; rv:16.0) Gecko/20100101 Firefox/16.0"
req.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
req.KeepAlive = True
req.Referer = "https://accounts.google.com/ServiceLoginAuth"
req.ContentType = "application/x-www-form-urlencoded"
Dim nbyteArray() As Byte = Encoding.Default.GetBytes(sPost)
req.ContentLength = nbyteArray.Length
Dim nDataStream As Stream = req.GetRequestStream()
nDataStream.Write(nbyteArray, 0, nbyteArray.Length)
nDataStream.Close()
Dim nResponse As HttpWebResponse = req.GetResponse()
nDataStream = nResponse.GetResponseStream()
Dim nreader As New StreamReader(nDataStream)
Dim nServerResponse As String = nreader.ReadToEnd()
nreader.Close()
nDataStream.Close()
nResponse.Close()
Return nServerResponse
End Function
i didnt tested it, but i think this will work
|
|
|
11/10/2012, 08:06
|
#19
|
elite*gold: 0
Join Date: May 2008
Posts: 1,222
Received Thanks: 500
|
Quote:
Originally Posted by Der Anbieter
Don't be that harsh, we all were beginners once 
|
Sorry, but I've told him already 5 times that he need the ID and not the name.. >.>
|
|
|
11/10/2012, 11:35
|
#20
|
elite*gold: 0
Join Date: Dec 2010
Posts: 500
Received Thanks: 249
|
I can show you by TeamViewer - skype:jordan.velikov3
|
|
|
11/10/2012, 16:43
|
#21
|
elite*gold: 0
Join Date: Mar 2011
Posts: 29
Received Thanks: 3
|
It work for input username and password but for button when i try to found the name there isn't...and it don't go
|
|
|
11/10/2012, 17:07
|
#22
|
elite*gold: 1
Join Date: Jun 2012
Posts: 5,819
Received Thanks: 3,200
|
Try this...
Code:
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
WebBrowser1.Navigate("https://accounts.google.com/ServiceLogin?hl=de&continue=http://www.google.it/")
WebBrowser1.ScriptErrorsSuppressed = True
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
WebBrowser1.Document.GetElementById("EMail").Innertext = Textbox1.Text
WebBrowser1.Document.GetElementById("Passwd).Innertext = Textbox2.Text
WebBrowser1.Document.GetElementById("signIn").InvokeMember("click")
End Sub
End Class
|
|
|
11/10/2012, 17:40
|
#23
|
elite*gold: 50
Join Date: Sep 2010
Posts: 846
Received Thanks: 223
|
Quote:
Originally Posted by 'Heaven.
Try this...
Code:
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
WebBrowser1.Navigate("https://accounts.google.com/ServiceLogin?hl=de&continue=http://www.google.it/")
WebBrowser1.ScriptErrorsSuppressed = True
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
WebBrowser1.Document.GetElementById("EMail").Innertext = Textbox1.Text
WebBrowser1.Document.GetElementById("Passwd).Innertext = Textbox2.Text
WebBrowser1.Document.GetElementById("signIn").InvokeMember("click")
End Sub
End Class
|
He wants to make it for facebook, not google.
|
|
|
11/10/2012, 17:44
|
#24
|
elite*gold: 35
Join Date: Jun 2012
Posts: 1,126
Received Thanks: 43
|
i´m not a VB.Net code but this you must use in C#
Code:
HtmlElementCollection elc = this.webBrowser1.Document.GetElementsByTagName("input");
foreach (HtmlElement el in elc)
{
if (el.GetAttribute("value") == "Anmelden")
{
el.InvokeMember("click");
}
}
because the Id of the Submit butten change every load the webseit new
I hope this help you away
|
|
|
11/10/2012, 17:52
|
#25
|
elite*gold: 1
Join Date: Jun 2012
Posts: 5,819
Received Thanks: 3,200
|
Try this...
Code:
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
WebBrowser1.Navigate("http://www.facebook.com/index.php?stype=lo&lh=Ac-CgxyyaJvgDn2I")
WebBrowser1.ScriptErrorsSuppressed = True
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim tmp1 As String = WebBrowser1.DocumentText.Replace(Chr(34), "")
Dim tmp() As String = Split(tmp1, "loginbutton")
Dim tmp2() As String = Split(tmp(1), ">")
Dim tmp3() As String = Split(tmp2(0), "for=")
WebBrowser1.Document.GetElementById(tmp3(1)).InvokeMember("click")
WebBrowser1.Document.GetElementById("email").Innertext = Textbox1.Text
WebBrowser1.Document.GetElementById("pass).Innertext = Textbox2.Text
Webbrwoser1.Document.GetElementById("default_persistent").InvokeMember("click")
Webbrowser1.Document.GetElementById(tmp3(1)).Invokemember("click")
End Sub
End Class
Quote:
Originally Posted by master_oli
i´m not a VB.Net code but this you must use in C#
Code:
HtmlElementCollection elc = this.webBrowser1.Document.GetElementsByTagName("input");
foreach (HtmlElement el in elc)
{
if (el.GetAttribute("value") == "Anmelden")
{
el.InvokeMember("click");
}
}
because the Id of the Submit butten change every load the webseit new
I hope this help you away
|
this is not good..Only working for german lang
|
|
|
11/11/2012, 20:12
|
#26
|
elite*gold: 0
Join Date: Mar 2011
Posts: 29
Received Thanks: 3
|
Quote:
Originally Posted by 'Heaven.
Try this...
Code:
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
WebBrowser1.Navigate("http://www.facebook.com/index.php?stype=lo&lh=Ac-CgxyyaJvgDn2I")
WebBrowser1.ScriptErrorsSuppressed = True
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim tmp1 As String = WebBrowser1.DocumentText.Replace(Chr(34), "")
Dim tmp() As String = Split(tmp1, "loginbutton")
Dim tmp2() As String = Split(tmp(1), ">")
Dim tmp3() As String = Split(tmp2(0), "for=")
WebBrowser1.Document.GetElementById(tmp3(1)).InvokeMember("click")
WebBrowser1.Document.GetElementById("email").Innertext = Textbox1.Text
WebBrowser1.Document.GetElementById("pass).Innertext = Textbox2.Text
Webbrwoser1.Document.GetElementById("default_persistent").InvokeMember("click")
Webbrowser1.Document.GetElementById(tmp3(1)).Invokemember("click")
End Sub
End Class
|
But if in wbebrowser navigate in the page  the code will be the egual code?
|
|
|
11/11/2012, 21:58
|
#27
|
elite*gold: 1
Join Date: Jun 2012
Posts: 5,819
Received Thanks: 3,200
|
Yes, this code it working for all facebooks
|
|
|
11/12/2012, 23:21
|
#28
|
elite*gold: 0
Join Date: Mar 2011
Posts: 29
Received Thanks: 3
|
Can you explain me this part of the code?
Quote:
Dim tmp1 As String = WebBrowser1.DocumentText.Replace(Chr(34), "")
Dim tmp() As String = Split(tmp1, "loginbutton")
Dim tmp2() As String = Split(tmp(1), ">")
Dim tmp3() As String = Split(tmp2(0), "for=")
WebBrowser1.Document.GetElementById(tmp3(1)).Invok eMember("click")
WebBrowser1.Document.GetElementById("email").Inner text = Textbox1.Text
WebBrowser1.Document.GetElementById("pass).Innerte xt = Textbox2.Text
Webbrwoser1.Document.GetElementById("default_persi stent").InvokeMember("click")
Webbrowser1.Document.GetElementById(tmp3(1)).Invok emember("click")
End Sub
|
|
|
|
11/13/2012, 12:13
|
#29
|
elite*gold: 1
Join Date: Jun 2012
Posts: 5,819
Received Thanks: 3,200
|
You set tmp1 as String = The sourcecode of Facebook without """
After this you Split Tmp1 , so you get The loginbuttonid
|
|
|
11/14/2012, 15:02
|
#30
|
elite*gold: 0
Join Date: Mar 2011
Posts: 29
Received Thanks: 3
|
What are Chr(34),Dim tmp2() As String = Split(tmp(1), ">") and
Dim tmp3() As String = Split(tmp2(0), "for=")?
|
|
|
 |
|
Similar Threads
|
Visual Basic 2010 Express CMD commands problem
02/29/2012 - .NET Languages - 5 Replies
Hallo epvp
Kurz und knapp
Ich will per VB eine neue CMD starten und dort dann diesen code einfügen:
@echo off
cls
color 02
a: echo%random% %random% %random% %random% %random% %random% %random%
goto a
|
Visual Basic Login-Form problem!
01/23/2012 - General Coding - 12 Replies
Hallo liebe Com.
Ich weiß nicht ob ich das richtige topic erwischt habe, wenn nicht bitte verschieben.
Zum Thema..
Ich versuche schon seit längerem eine VB Login-Form zu erstellen die über SQL / MSQL läuft, am liebsten wäre mir über mein SQL was ich auf PC hab oder solch einer Datenbank seite.
Ich hab schon das tutorial hier gesehen auf EPVP: www.elitepvpers.com/forum/epvp-coders-tutorials/58 7234-vb-2008-how-login-und-registrierung-ein-progr amm-einbauen.html
|
[Visual Basic 2010] Habe ein Problem mit...
10/13/2011 - .NET Languages - 11 Replies
Heyho Elitepvpers. :handsdown:
Ich habe ein kleines Problem mit meinem Programm, welches ich in Visual Basic 2010 gecodet habe.
Es ist ein sogenannter "Anti AFK Bot".
Dieser schreibt jede 30Sekunden /back und das Server Passwort was man in der Textbox eingibt.
Problem:
Wenn ich auf "Start" klicke, hängt sich die Anwendung auf, bzw. keine Rückmeldung, arbeitet aber trotzdem weiter.
|
Visual Basic (2010) Problem
05/22/2011 - .NET Languages - 3 Replies
Huhu!
Ein Anfänger braucht Hilfe... Ich!
Ich fange gerade mit dem VB Coden an.
Habe mir dazu mal VB 2010 runtergeladen & mich direkt
an ein kleines Projekt bezgl. Warrock gemacht.
Alles lief gut, bis ich eine ComboBox einfügte...
Nunja, folgender Fehler kommt:
"end of"-Anweisung erwartet
Nach langem googlen kam ich darauf, dass ich einen Fehler gemacht habe.
|
[Visual Basic 2010]WMI Generator Problem
04/21/2011 - .NET Languages - 0 Replies
Hallo, ich bin dabei einen HWID GEN zu coden.
Ich habe mir einen WMI gen 5. von Microsoft gedownloadet, und oben auch VisualBasic.Net ausgewählt. (Prog. Sprache)
Alles funzt. sogar mein MD5 Hash Code.
Also ich bekomme den Code hier von Generator:
Imports System
Imports System.Management
Imports System.Windows.Forms
|
All times are GMT +1. The time now is 17:28.
|
|