这段代码有什么问题我无法登录 [英] What's wrong with this code I can not login

查看:80
本文介绍了这段代码有什么问题我无法登录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此代码有什么问题我无法登录

What's wrong with this code I can not login

Imports System.Text
Imports System.IO
Imports System.Net

Public Class Form1
Dim logincookie As CookieContainer

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Try



Dim tempCookies As New CookieContainer
Dim encoding As New UTF8Encoding
Dim PostData As String = "login_email=" + TextBox1.Text & "&login_password=" & TextBox2.Text

Dim byteData As Byte() = encoding.GetBytes(PostData)
Dim postReq As HttpWebRequest = DirectCast(WebRequest.Create("https://www.paypal.com"), HttpWebRequest)
postReq.KeepAlive = True
postReq.Host = "www.paypal.com"
postReq.UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:30.0) Gecko/20100101 Firefox/30.0"
postReq.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8v"
postReq.Method = "POST"

postReq.CookieContainer = tempCookies
postReq.ContentType = "application/x-www-form-urlencoded"
postReq.Referer = "https://www.paypal.com/webapps/mpp/home"
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 data As String = postreqreader.ReadToEnd()
RichTextBox1.Text = data
WebBrowser1.DocumentText = RichTextBox1.Text
postreqreader.Close()
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
End Class





请更正的代码



Please corrected code

推荐答案

永远不要接受来自不安全网站的代码来处理任何与真钱有关的事情。

你不知道谁给你他代码,你不知道它做了什么,你不知道它将钱正确地放入适当的帐户,而不将细节传递给任何第三方。



只从PayPal获取此类代码 - 否则欺诈的范围太大。请记住,如果您的行为被视为疏忽,您本人可能要对任何损失承担责任 - 从公共论坛获取您的代码肯定会是!
Never, ever, accept code from a insecure website to handle anything to do with real money.
You do not know who is giving you the code, you do not know what it does, you do not know that it places the monies correctly into the appropriate account, without passing the details to any third parties.

Only get such code from PayPal - the scope for fraud otherwise is far too large. And remember, you personally could be liable for any monies lost if your action is seen to be negligent - which getting your code from a public forum would most certainly be!


这篇关于这段代码有什么问题我无法登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆