Results 1 to 3 of 3

Thread: Problem running the code

  1. #1
    PJSantos100 is offline VB.NET Forum Newbie
    .NET Framework
    .NET 3.0
    Join Date
    Apr 2014
    Posts
    2
    Reputation
    0

    Problem running the code

    Hi Guys, first of all let me say this forum is great and there are a lot of expert people here....

    I'm facing a problem when i try to run my app. I have a code to click and extract info from a website and based on that information i need to do some calculations and send it again to the site, the code is working well but i need to put some messagebox in the middle to work (i started just to debug the code).
    So let's say i have 3 main functions like (Calculation, Right and wrong)... When it does the calculation the app see if I'm right or wrong and base on that i'll call the right/wrong function.... then I'll come back to the calculation....

    This is the calculation function: In the 1st and 3rd line its the messagebox that i placed just to debug ......

    Private Sub calculos()

    MessageBox.Show("start calculos", "Inicio")

    System.Threading.Thread.Sleep(5000)

    MessageBox.Show("timer passed")


    TextBox5.Text = Ultima_App


    Dim htmlElements As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName("input")

    For Each el As HtmlElement In htmlElements ' Le o Bet Size do SITE
    If el.GetAttribute("id").Equals("BetSizeInput") Then
    TextBox2.Text = el.GetAttribute("value")
    End If
    Next

    Ultimo_Val = CDbl(Val(TextBox2.Text))

    Dim allelements As HtmlElementCollection = WebBrowser1.Document.All

    Resultado = WebBrowser1.Document.GetElementById("LastBetInfoProfit").InnerHtml
    TextBox3.Text = Resultado


    If Resultado > 0.0 Then
    TextBox4.Text = "Acertou"
    Call Acerto()
    ElseIf Resultado < 0.0 Then
    TextBox4.Text = "Falhou"
    Call Falha()
    End If

    End Sub


    Anyone has a clue???

  2. #2
    jmcilhinney's Avatar
    jmcilhinney is offline VB.NET Forum Moderator
    .NET Framework
    .NET 4.0
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    13,805
    Reputation
    1705
    I have formatted your code snippet for readability. Please do so for us in future, i.e. use something like:

    [xcode=vb]your code here[/xcode]

    As for the issue, you haven't actually explained what it is. You've provided the relevant code, which is good, but you have really explained what you expect to happen and how that differs from what actually happens.

  3. #3
    PJSantos100 is offline VB.NET Forum Newbie
    .NET Framework
    .NET 3.0
    Join Date
    Apr 2014
    Posts
    2
    Reputation
    0
    Quote Originally Posted by jmcilhinney View Post
    I have formatted your code snippet for readability. Please do so for us in future, i.e. use something like:

    [xcode=vb]your code here[/xcode]

    As for the issue, you haven't actually explained what it is. You've provided the relevant code, which is good, but you have really explained what you expect to happen and how that differs from what actually happens.
    Hello jm, thanks for the reply and next one I'll try to format it :-).... So let me explain you .... i have a app which has 3 functions... (Calculos, Acerto , Falha).....
    Starting on calculos: The app should read from the web certain value and compare with my prediction... if i'm righ i call acerto() , if i'm wrong it should call falha. In this falha/acerto i'm doing some calculation and after that i call again the function acerto().... Everything is working(but only with that message boxes in the middle!)

    I've just place the messageboxes with debug propose, but the reality is when i remove the same the code simply doesn't work as expected...

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •