重载决策失败,因为没有可访问的'Rnd'接受此数量的参数

时间:2015-12-03 01:25:10

标签: vb.net out-of-memory

Public Class Form1
Dim r As New Random
Dim angka As Long = True
Dim i As Integer
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    WebBrowser1.Navigate(TextBox3.Text)
    WebBrowser1.ScriptErrorsSuppressed = True
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
    WebBrowser1.Navigate(TextBox3.Text)
    TextBox1.Text = "803057" + r.Next(0, 100000).ToString
    angka = Rnd(0, 100000000000000).ToDouble
    TextBox2.Text = angka
End Sub

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    WebBrowser1.Document.GetElementById("username_member").SetAttribute("value", TextBox1.Text)
    WebBrowser1.Document.GetElementById("password_member").SetAttribute("value", TextBox2.Text)
    WebBrowser1.Document.GetElementById("submit").InvokeMember("click")
End Sub

结束班级enter image description here

喂, 我的项目有错误,有人可以帮助我吗?

1 个答案:

答案 0 :(得分:1)

您不能只调用不存在的方法。没有Rnd方法接受两个参数,因此您无法调用此类方法。如果您需要的是随机Long值,那么您需要生成该值。这样做的方法是调用Random.NextDouble,然后自己执行扩展,或者使用适当大小的Random.NextBytes数组调用Byte,然后调用BitConverter.ToInt64。在这种情况下,假设您有特定的范围要求,我会选择第一个选项。