Link to home
Start Free TrialLog in
Avatar of RGuillermo
RGuillermoFlag for United States of America

asked on

.net app works in some computers and does not in some others

Hi Experts,
I have a very small app developed in visual studio 2012 with visual basic, it is a specific very small automatizacion of a website. Compiled with .net 4.5

The fact is it works fine in some computers and in some others it says:

"unhandled exception has ocurred un your application. If you click continue the application ill ignore this error and attempt to continue. If you click quit the application will close inmediately... object referenece not set to an instance of an object."

Below you will find the code
Please your support on this.
Best regards,
R

Imports System
Imports System.IO
Imports System.Collections
Imports System.Threading

Public Class broserwindow
    Public MyFileName As String
    Public MyNewLine As String

    Dim w_pat_cod As String, w_azv_cod As String, w_ptl_usr As String, w_ptl_pwd As String, ss_tmp_fdr As String
    Dim sw_gee_res_gev As Boolean = False, sw_delay As Boolean = False
    'Dim stepcounter As Integer, t4_cnt As Integer
    Dim xstepcounter As Integer = 0
    Dim t4_cnt As Integer = 0

    Private Sub browser_load(sender As Object, e As EventArgs) Handles MyBase.Load
        Me.Location = New Point(800, 200)
        READ_DATA_01()
        wb.Navigate("www.website.com")
    End Sub

    Private Sub Timer0_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer0.Tick
        Timer0.Enabled = False
        after_load()
    End Sub
    Private Sub after_load()
        Dim n As Integer
        'MsgBox("Afterload")
        'Me.Location = New Point(1000, 400)
        n = 0
        If w_azv_cod = "" Or Val(w_azv_cod) <= 0 Then
            Timer1.Enabled = False
            MsgBox(" No patient AZV Code. " + StrDup(2, vbCrLf) + _
                  " Please update database", vbOKOnly, " Data Control")
            Do While True
                If Me.wb.ReadyState <> WebBrowserReadyState.Complete Then
                    End
                Else
                    n = n + 1
                End If
                If n = 2000 Then
                    End
                End If
            Loop
        Else
            Timer1.Enabled = True
        End If
    End Sub
    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Timer1.Enabled = False
        Timer2.Enabled = False
        Timer3.Enabled = False
        Me.Begin.PerformClick()
    End Sub

    Private Sub READ_DATA_01()

        MyFileName = "c:\tmp\ss_tmp_fdr.txt"

        FileOpen(1, MyFileName, OpenMode.Input)
        ss_tmp_fdr = Trim(RTrim(LineInput(1)))
        FileClose(1)

        MyFileName = ss_tmp_fdr + "azv_cod_txt.txt"
        FileOpen(1, MyFileName, OpenMode.Input)
        w_pat_cod = Trim(RTrim(LineInput(1)))
        w_azv_cod = Trim(RTrim(LineInput(1)))
        w_ptl_usr = Trim(RTrim(LineInput(1)))
        w_ptl_pwd = Trim(RTrim(LineInput(1)))
        FileClose(1)

        'If My.Computer.FileSystem.FileExists(MyFileName) Then
        ' My.Computer.FileSystem.DeleteFile(MyFileName)
        'End If

    End Sub
    Private Sub SetTextboxText(ByVal fld As String, ByVal Text As String)
        On Error GoTo a0001
        DirectCast(GetCurrentWebForm.item(fld), mshtml.HTMLInputElement).value = Text
        GoTo a0002
a0001:
        MsgBox("INTERNET SLOW")
a0002:
        On Error GoTo 0
    End Sub
    Private Sub ClickSubmitButton()
        'DirectCast(GetCurrentWebForm.item("cmdSubmitMe", 0), mshtml.HTMLButtonElement).click()
        'Return 'so we don't call the below method
        On Error GoTo b001
        GetCurrentWebForm.submit()
        GoTo b002
b001:
        MsgBox("internet slow  2")
b002:
    End Sub

    Private Function GetCurrentWebDoc() As mshtml.HTMLDocument
        'Dim X7 As String
        Try
            'X7 = CStr(DirectCast(wb.Document, mshtml.HTMLDocument))
            Return DirectCast(wb.Document, mshtml.HTMLDocument)
        Catch ex As Exception
            Return Nothing
        End Try
    End Function
    Private Function GetCurrentWebForm() As mshtml.HTMLFormElement
        Try
            If GetCurrentWebDoc.forms.length > 0 Then
                Return DirectCast(GetCurrentWebDoc.forms.item(0), mshtml.HTMLFormElement)
            Else
                Return Nothing
            End If
        Catch ex As Exception
            Return Nothing
        End Try
    End Function
    Private Function GetLinks() As String
        Dim Temp As String = String.Empty, w_href As String = String.Empty
        Dim i As Integer = 1
        For Each MyLink As mshtml.HTMLAnchorElement In GetCurrentWebDoc.links
            Temp &= i.ToString & ")" & Environment.NewLine
            'MessageBox.Show(Temp)
            Temp &= "Text: " & MyLink.innerText & Environment.NewLine & " URL: " & MyLink.href & Environment.NewLine & Environment.NewLine
            w_href = MyLink.href
            i += 1
            If i = 4 Then
                Exit For
            End If
        Next
        Return w_href
    End Function
    Private Sub GetTextboxText()
        MessageBox.Show("Value Is: " & DirectCast(GetCurrentWebForm.item("txtBox"), mshtml.HTMLInputElement).value)
    End Sub

    'FILLS THE HTML TEXT AREA WITH TEXT FROM OUR WINFORM
    Private Sub SetTextareaText(ByVal Text As String)
        DirectCast(GetCurrentWebForm.item("txtArea"), mshtml.HTMLTextAreaElement).value = Text
    End Sub
    'GETS THE TEXT FROM THE HTML TEXT AREA AND DISPLAYS IT IN A MESSAGEBOX
    Private Sub GetTextareaText()
        MessageBox.Show("Value Is: " & DirectCast(GetCurrentWebForm.item("txtArea"), mshtml.HTMLTextAreaElement).value)
    End Sub

    'SET THE RADIO BUTTONS CHECKED. NOTICE THEY ARE BOTH CALLED THE SAME THING, BUT THE INDEX IS DIFFERENT.
    '    Private Sub SetRadioYesChecked()
    '        If rdoRadioYes.Checked Then
    '            DirectCast(GetCurrentWebForm.item("rdoSelection", 0), mshtml.HTMLOptionButtonElement).checked = True
    '        Else
    '            DirectCast(GetCurrentWebForm.item("rdoSelection", 1), mshtml.HTMLOptionButtonElement).checked = True
    '        End If
    '    End Sub

    'CLICKS THE REGULAR HTML BUTTON (WHICH CALLS A JAVASCRIPT IN THE HTML PAGE TO SHOW THAT IT WORKED)
    Private Sub ClickNormalButton()
        DirectCast(GetCurrentWebForm.item("cmdClickMe", 0), mshtml.HTMLButtonElement).click()
    End Sub

    'GRABS THE DIV TAG AND CHANGES ITS COLOR (AND TEXT) TO SHOW HOW TO MANIPULATE NON FORM ELEMENTS
    Private Sub ChangeDIVColor()
        Dim MyDiv As mshtml.HTMLDivElement = DirectCast(GetCurrentWebDoc.all.item("divTesting"), mshtml.HTMLDivElement)

        If MyDiv.style.backgroundColor.ToString = "silver" Then
            MyDiv.style.backgroundColor = "yellow"
            MyDiv.innerText = "I AM YELLOW"
        Else
            MyDiv.style.backgroundColor = "silver"
            MyDiv.innerText = "I AM SILVER"
        End If

    End Sub

    'SHOW THE SOURCE HTML OF THE PAGE BEING VIEWED
    'I PUT THIS IN ANOTHER FORM BECAUSE SHOWING THE SOURCE IN A MESSAGEBOX CAN BE ANNOYING
    'Private Sub ShowPageSource()
    ' Dim F As New frmSource
    '    F.txtSource.Text = GetCurrentWebDoc.documentElement.GetHashCode.ToString() '.outerHTML
    '   F.ShowDialog(Me)
    '  F.Dispose()
    '    F = Nothing
    'End Sub

    'EXECUTES THE JAVASCRIPT FUNCTION NAMED HelloWorld() IN THE HTML DOCUMENT
    Private Sub ExecuteJavascript()
        GetCurrentWebDoc.parentWindow.execScript("vkchecksSearchResult()", "javascript")
    End Sub

    'PRINTS THE CURRENT WEBPAGE. PRINTS UP THE SELECT PRINTER DIALOG JUST LIKE IE
    Private Sub PrintPage()
        Try
            GetCurrentWebDoc.execCommand("Print", True)
        Catch ex As Exception
        End Try
    End Sub


    'THIS WILL LOOK THE IMAGES ON THE WEBPAGE, AND DISPLAY THEIR SRC VALUES
    Private Sub GetImageInfo()
        'GET OUR 2 IMAGES
        Dim MyImages(21) As mshtml.HTMLImg
        Dim temp As String = "Image Sources: " & Environment.NewLine & Environment.NewLine
        Dim x As Integer
        x = GetCurrentWebDoc.images.length - 1
        For i As Integer = 0 To x
            MyImages(i) = DirectCast(GetCurrentWebDoc.images.item(, i), mshtml.HTMLImg)
            temp &= MyImages(i).src & Environment.NewLine
        Next

        MessageBox.Show(temp)

    End Sub


    'THIS WILL GET THE COMBOBOX FROM THE HTML FORM, AND IT WILL
    'DISPLAY THE SELECTED INDEX AND VALUE
    Private Sub GetComboValue()

        Dim MyHTMLCombo As mshtml.HTMLSelectElement = DirectCast(GetCurrentWebForm.item("cmboItems"), mshtml.HTMLSelectElement)

        MessageBox.Show("Current Selected Index: " & MyHTMLCombo.selectedIndex & Environment.NewLine & _
                        "Current Selected Value: " & MyHTMLCombo.value & Environment.NewLine)

    End Sub

    Private Sub ClickCheckBox()
        Dim MyInputElement As mshtml.HTMLInputElement = DirectCast(GetCurrentWebForm.item("chkBox", 0), mshtml.HTMLInputElement)

        MyInputElement.checked = Not MyInputElement.checked
    End Sub

    ' Private Sub rdoPageTypeChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)

    Private Sub wb_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs)

    End Sub

    Private Sub cmd_id_ele_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmd_id_ele.Click
        ' Dim mapElements As HtmlElementCollection = GetCurrentWebForm.getElementsByTagName("map")
        ' Dim inputElements As HtmlElementCollection = wb.cGetElementsByTagName("input")
        Dim mapElements As mshtml.IHTMLElementCollection = CType(GetCurrentWebForm.getElementsByTagName("BUTTON"), mshtml.IHTMLElementCollection)
        Dim x As Integer
        x = 0
        For Each aa As mshtml.IHTMLElement In mapElements
            x +=
            MsgBox(Str(x) + "OuterHtml :" & aa.outerHTML & vbCrLf & vbCrLf & vbCrLf & "InnerHtml :" & aa.innerHTML & vbCrLf)
            'MsgBox("InnerHtml :" & aa.innerHTML & vbCrLf)

            'MsgBox(Str(x) & " -- " & aa.innerHTML)
            'If element.tagName.getAttribute("MappingType").ToLower.Equals("submit") AndAlso _
            '    element.getAttribute(v("VALUE").ToLower.Equals("login") Then
            'element.InvokeMember("click")
            'element.InvokeMember("submit")
            'End If
        Next
    End Sub

    Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        GetCurrentWebForm()
        GetImageInfo()
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        If Me.wb.ReadyState = WebBrowserReadyState.Complete Then
            GetCurrentWebDoc.parentWindow.execScript("vkchecksSearchResult()", "javascript")
        Else
            MsgBox(" web page 4: Downloading...")
        End If
    End Sub

    'Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
    'Dim F As New frmSource
    '   GetCurrentWebForm()
    '  F.txtSource.Text = GetCurrentWebDoc.documentElement.outerHTML
    ' F.ShowDialog(Me)
    'F.Dispose()
    '    F = Nothing
    'End Sub

    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles sluiten.Click
        Dim Temp As String = String.Empty
        Dim i As Integer = 1
        If Me.wb.ReadyState = WebBrowserReadyState.Complete Then
            For Each MyLink As mshtml.HTMLDivElement In GetCurrentWebDoc.getElementsByTagName("button")
                Temp = MyLink.outerHTML & Chr(13)
                DirectCast(MyLink, mshtml.HTMLButtonElement).click()
                i += 1
            Next
        Else
            MsgBox("web page 6: downloading...")
        End If
        xstepcounter = 2
    End Sub


    '    Private Sub GroupBox1_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GroupBox1.Enter

    'End Sub

    Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Portaal.Click
        wb.Navigate("www.website.com")
        xstepcounter = 0
    End Sub

    Private Sub cmdGo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles use_pwd.Click

        If Me.wb.ReadyState = WebBrowserReadyState.Complete Then

            SetTextboxText("loginnaam", w_ptl_usr)
            'Me.wb.Refresh()
            SetTextboxText("Password", w_ptl_pwd)
            espera_a_la_web(3000)
            ClickSubmitButton()
            GetCurrentWebForm()
        Else
            MsgBox(" page1 still downloading...")
        End If

        xstepcounter = 1
    End Sub
    Private Sub cmdGetLinks_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles vg_chk.Click
        Dim Temp As String = String.Empty
        'Dim i As Integer = 1
        If Me.wb.ReadyState = WebBrowserReadyState.Complete Then
            'MsgBox("vg - 1")
            'For Each MyLink As mshtml.HTMLDivElement In GetCurrentWebDoc.getElementsByTagName("a")
            For Each MyLink As mshtml.HTMLAnchorElement In GetCurrentWebDoc.getElementsByTagName("a")
                'MsgBox("vg - 2")
                Temp = UCase(MyLink.outerHTML & Chr(13))
                If Temp.IndexOf("VG-CHECKS") >= 0 Then
                    'MsgBox(Temp)
                    DirectCast(MyLink, mshtml.HTMLAnchorElement).click()
                    Exit For
                    'i += 1
                End If
            Next
        Else
            MsgBox("web page 6: downloading...")
        End If
        xstepcounter = 2

        'Dim w_href As String = String.Empty
        'If Me.wb.ReadyState = WebBrowserReadyState.Complete Then
        'w_href = GetLinks()
        'MessageBox.Show(w_href)
        'wb.Navigate(w_href)
        'GetCurrentWebForm()
        'Else
        'MsgBox(" Web page 2: Still downloading...")
        'End If
        'stepcounter = 2
    End Sub
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles azv_cod.Click
        READ_DATA_01()

        'MessageBox.Show(w_azv_cod)
        'espera_a_la_web(30000)

        If Me.wb.ReadyState = WebBrowserReadyState.Complete Then
            SetTextboxText("RelatieNummer", w_azv_cod)

            REM ******** critical line
            GetCurrentWebDoc.parentWindow.execScript("vkchecksSearchResult()", "javascript")
            'espera_a_la_web(7000)

        Else
            MsgBox(" Web page 3: Still Downloading...")
        End If
        If True Then

        End If

        xstepcounter = 3
    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Open.Click
        Timer1.Enabled = False
        If Me.wb.ReadyState = WebBrowserReadyState.Complete Then
            'Timer1.Enabled = False
            'Timer3.Enabled = True
            'MsgBox(" Processing...", vbOKOnly, " Process control...")
            exists_code.PerformClick()
            If sw_gee_res_gev Then
                MsgBox(" Code not registered at AZV web Portaal. ", vbOKOnly, " Data Control....")
                sw_gee_res_gev = False
                xstepcounter = 5
                Me.Timer1.Enabled = False
                Me.Timer2.Enabled = False
            Else
                GetCurrentWebDoc.parentWindow.execScript("loadVkchecksDialog(" + w_azv_cod + ")", "javascript")
                xstepcounter = 4
                Me.Timer1.Enabled = False
                Me.Timer2.Enabled = True
            End If
        Else
            MsgBox(" Web page 5: Downloading...")
        End If
    End Sub

    Private Sub Button7_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles wis.Click
        If Me.wb.ReadyState = WebBrowserReadyState.Complete Then
            GetCurrentWebDoc.parentWindow.execScript("clearForm()", "javascript")
        Else
            MsgBox(" Web page 7: downloading...")
        End If
        xstepcounter = 2
    End Sub

    Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bClose.Click
        Close()
    End Sub

    Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
        GetCurrentWebDoc()
        Me.wb.Focus()
        SendKeys.Send("{HOME}")
    End Sub

    Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Begin.Click
        'Dim childform1 As New Form1
        'childform1.Show()
        Timer1.Enabled = False
        While True
            If xstepcounter = 0 Then
                ''Timer1.Enabled = False
                If Me.wb.ReadyState <> WebBrowserReadyState.Complete Then
                    Form1.Show()
                    Timer1.Enabled = True
                    Exit While
                Else
                    'espera_a_la_web(40000)

                    use_pwd().PerformClick()

                End If
                Timer1.Enabled = True
                Exit While
            End If

            If xstepcounter = 1 Then
                ''Timer1.Enabled = False
                If Me.wb.ReadyState <> WebBrowserReadyState.Complete Then
                    t4_cnt = 1000
                    'sw_delay = True
                    Timer4.Interval() = 2000
                    Timer5.Enabled = True
                    Form1.Timer1.Interval() = Timer4.Interval()
                    Timer4.Enabled = True
                    Form1.Show()
                    Timer1.Enabled = True
                    Exit While
                Else
                    Timer1.Enabled = False
                    'MsgBox("1111111")
                    vg_chk().PerformClick()
                    espera_a_la_web(4000)
                    'MsgBox("aa")
                End If
                Timer1.Enabled = True
                Exit While
            End If

            If xstepcounter = 2 Then
                ''Timer1.Enabled = False
                If Me.wb.ReadyState <> WebBrowserReadyState.Complete Then
                    t4_cnt = 2000
                    sw_delay = True
                    Timer1.Enabled = False
                    Timer4.Interval() = 2000
                    Timer5.Enabled = True
                    Form1.Timer1.Interval() = Timer4.Interval()
                    Timer4.Enabled = True
                    Form1.Show()
                    Timer1.Enabled = True
                    Exit While
                Else
                    azv_cod().PerformClick()
                    'espera_a_la_web (4000)
                End If
                Timer1.Enabled = False
            End If

            If xstepcounter = 3 Then
                ''Timer1.Enabled = False

                If Me.wb.ReadyState <> WebBrowserReadyState.Complete Then
                    'MsgBox("a")
                    espera_a_la_web(4000)
                    t4_cnt = 3000
                    sw_delay = True
                    Timer1.Enabled = False
                    Timer4.Interval() = 2000
                    Timer5.Enabled = True
                    Form1.Timer1.Interval() = Timer4.Interval()
                    Timer4.Enabled = True
                    Form1.Show()
                    Timer1.Enabled = True
                    Exit While
                Else
                    'MsgBox("3333333")

                    Open().PerformClick()
                    'MsgBox("end 3333333")
                End If
                If xstepcounter = 5 Then
                    Timer1.Enabled = False
                Else
                    Timer1.Enabled = True
                End If
                Timer1.Enabled = True
            End If

            Exit While
        End While
    End Sub

    Private Sub Button11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button11.Click
        GetCurrentWebDoc()
        Me.wb.Focus()
        SendKeys.Send("{END}")
    End Sub

    Private Sub search_again_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles clear_search.Click
        sluiten.PerformClick()
        wis.PerformClick()
    End Sub

    Private Sub Button4_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        Timer2.Enabled = False
        azv_cod().PerformClick()
        Begin.PerformClick()
    End Sub

    Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
        clear_search.PerformClick()
        Me.Timer2.Enabled = False
    End Sub

    Private Sub Button5_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
        Me.Timer2.Enabled = False
    End Sub
    Private Sub s_hide_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles s_hide.Click

        Dim file As System.IO.StreamWriter, v1 As String = ss_tmp_fdr & "azv_req_flag_01.txt"
        file = My.Computer.FileSystem.OpenTextFileWriter(v1, True)
        file.WriteLine("AZV Request Module active.")
        file.Close()

        Me.Visible = False
        Me.Timer7.Enabled = True
    End Sub

    Private Sub Timer3_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer3.Tick
        SendKeys.Send("{enter}")
        'Timer1.Enabled = True
        Timer3.Enabled = False
        Timer2.Enabled = True
    End Sub


    Private Sub exists_code_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles exists_code.Click
        Dim Temp As String = String.Empty
        Dim i As Integer = 1
        Timer1.Enabled = False
        Temp = ""

        delay(3)
        If Me.wb.ReadyState = WebBrowserReadyState.Complete Then

            For Each MyLink As mshtml.HTMLLabelElement In GetCurrentWebDoc.getElementsByTagName("label")
                Temp = MyLink.outerHTML & Chr(13)
                'MsgBox(Temp)
                If UCase(Temp).IndexOf("GEEN RESULTATEN GEVONDEN") >= 0 Then
                    sw_gee_res_gev = True
                End If
                i += 1
            Next
        Else
            MsgBox("exist_code failed...")
        End If
        xstepcounter = 5

    End Sub

    Private Sub Timer4_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer4.Tick
        'Timer1.Enabled = True
        Timer4.Enabled = False
        Timer5.Enabled = False
    End Sub

    Private Sub wb_Enter_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles wb.Enter

    End Sub

    Private Sub Timer5_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer5.Tick
        t4_cnt += 1
        Label1.Text = CStr(t4_cnt)
    End Sub
    Private Sub espera_a_la_web(ByVal p_milisec As Integer)
        Dim nn As Integer
        nn = 0
        Do While True
            If Me.wb.ReadyState <> WebBrowserReadyState.Complete Then
                MsgBox("nothing")
            Else
                nn += 1
                Label1.Text = CStr(nn) + " / " + CStr(p_milisec)
            End If
            If nn >= p_milisec Then
                Exit Do
            End If
        Loop
    End Sub
    Sub delay(ByVal dblSecs As Double)
        Const OneSec As Double = 1.0# / (1440.0# * 60.0#)
        Dim dblWaitTil As Date
        Now.AddSeconds(OneSec)
        dblWaitTil = Now.AddSeconds(OneSec).AddSeconds(dblSecs)
        Do Until Now > dblWaitTil
            Application.DoEvents()
        Loop
    End Sub

    Private Sub Timer6_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer6.Tick
        'If System.IO.File.Exists() Then
        'End If

    End Sub

    Private Sub broserwindow_FormClosing(sender As Object, e As FormClosingEventArgs) Handles MyBase.FormClosing
        Dim v1 As String = ss_tmp_fdr & "azv_req_flag_01.txt"

        If My.Computer.FileSystem.FileExists(v1) Then
            My.Computer.FileSystem.DeleteFile(v1)
        End If

    End Sub

    Private Sub Timer7_Tick(sender As Object, e As EventArgs) Handles Timer7.Tick
        Dim v1 As String = ss_tmp_fdr + "azv_cod_txt.txt"
        If My.Computer.FileSystem.FileExists(v1) Then
            'Button1_Click()
        End If


    End Sub
End Class
Avatar of Member_2_6481058
Member_2_6481058
Flag of Austria image

Hello,

can you put the Code in a Document and Attach it, its quite hard to follow track on such long questions ;)

to your problem: Have you checked whether both Computers do have .net 4.5 installed on them?
What does the machines set apart? OS, SP-Level, Patches, anything would be appreciated :)
Hello, Can you check event viewer logs, such type of errors got logged in event viewer, so can get idea from there.

The reason for failure might be some systems not support .net 4.5 for any reason or having connectivity problem to get correct components for your application.
Avatar of Dave Baldwin
Don't know what computers you're trying to run it on but you can't even install .NET 4.5 on Windows XP so it won't run your program.
Avatar of RGuillermo

ASKER

Smighty,
the code is now attached in a word doc.
Yes both machines have .net 4.5
regarding what sets them apart... its a variety of pcs where the small app works... win win xp, win 7 , win 8 .... with each system sotimes works and sometime specially if the internet is slow it does not....
pathces and OS cant really verify in so many machines but they have to be more or less uptode.

Vjsoft:
I checked the even viewer and nothing special so far
Yes sometimes the internet gets slower.

DaveBaldwin,
They are like 50 pcs some with xp some with win 7 and some others  with win 8
very few with win xp, so I am thinking compiling for .net 3.5
will that work in all OSs?

thanks to all
vb-app.docx
.NET 3.5 works on Windows XP.
yes, if you are aiming for compatibility with Windows XP you'd have to go for .net 3.5
Windows 7 and are able to support .net 4.0 and 4.5
ASKER CERTIFIED SOLUTION
Avatar of ktaczala
ktaczala
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Please do no change the code, firs try of any Windows 7 or higher system. You can also try Windows Server 2008 R2 also.