codeorder 197 Nearly a Posting Virtuoso

>>which one cannot be considered as a counter variable?
I would say line.4.
.reason: Dim counter As Integer is = to a default.value of 0 and no other line returns a 0 AndAlso counter = 0 *2 will give you the same result as counter = counter *2 .
.p.s.: I don't even know w.t.f a "counter variable" is;though hope this helps.:)

codeorder 197 Nearly a Posting Virtuoso

>>Actually, you were given a pretty dumb question.
.confusing as well;must say, good teacher.:)

codeorder 197 Nearly a Posting Virtuoso

Disregard my previous post If this takes care of the issue.

Public Class Form1
    Private lClock As Label, btnStop As Button, sw() As Stopwatch
    Private iTotalParticipants As Integer '// keep count of players.
    Private sButtonName As String = "Stop", sLabelName As String = "Clock", sButtonDone As String = "Done"
    Private pnMain As Panel

    Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        pnMain = Panel1 '// Take control of Panel.
        With Button1 : .Text = ".new" : .Cursor = Cursors.Hand : End With
        With Button2 : .Text = ".add" : .Cursor = Cursors.Hand : End With
    End Sub

    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        pnMain.Controls.Clear() '// clear.Panel.
        iTotalParticipants = 0 '// reset players.
        createInitialStopWatches(2) '// start w/2 players.
    End Sub

    Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
        createInitialStopWatches(1) '// a single player.
    End Sub
#Region "-----===-----===-----===-----===-----=== DYNAMIC.CONTROLS ===-----===-----===-----===-----===-----"

    Private Sub createInitialStopWatches(ByVal numberOfParticipantsToAdd As Integer)
        For i As Integer = 1 To numberOfParticipantsToAdd
            iTotalParticipants += 1 '// increase players total.
            addStopWatchControls(iTotalParticipants) '// add new.player's controls.
        Next
    End Sub

    Private Sub addStopWatchControls(ByVal selCtlIndex As Integer)
        ReDim Preserve sw(iTotalParticipants) '// Redim the StopWatch.Array and keep previous stopWatches.
        sw(selCtlIndex) = New Stopwatch '// new stopWatch for new participant.
        sw(selCtlIndex).Start()

        lClock = New Label : With lClock
            .Name = sLabelName & selCtlIndex
            .Size = New Size(100, 20) : .Location = New Point(139, (5 + ((selCtlIndex - 1) * 26)))
            .BorderStyle = BorderStyle.Fixed3D : .TextAlign = ContentAlignment.MiddleRight
        End With : pnMain.Controls.Add(lClock) '// add.Label.

        btnStop = New Button …
thedonedeal commented: Love It.. Just a bit of tinkering on my end. But thanks! +2
codeorder 197 Nearly a Posting Virtuoso

q.q.(quick.question)
If 2.participants running time of "00:23:45" and you add a new.participant, should the new.participant start w/"00:00:00", or should they start w/"00:23:45"

codeorder 197 Nearly a Posting Virtuoso

>>Is this the final conclusion why u asked me to test for zero rather than dividing it?
.i think so As well.
reason: Running the Try/Catch/etc., it sends the p.c. into shock Not just your tiny little app.

Hope this helps.:)

codeorder 197 Nearly a Posting Virtuoso

Post your current.code, I'll see what I can do from there.
[edit]
>>Would you mind telling me what exactly the lines of code do, I haven't seen that kind of syntax before.
If not same code as mine previously posted, I'll comment the previously posted one, otherwise I'll comment your current.code.:)
+= glad I could help.

codeorder 197 Nearly a Posting Virtuoso

I had a chance to play w/this "stopwatch" thread and got this.

Public Class Form1
    Private lParticipantClock As Label, btnParticipantStop As Button, tmrParticipantTimer As Timer
    Private iTotalParticipants As Integer

    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        iTotalParticipants = 5
        createStopWatches(iTotalParticipants)
    End Sub

    Private Sub createStopWatches(ByVal TotalParticipants As Integer)
        For indexCounter As Integer = 1 To TotalParticipants Step 1

            lParticipantClock = New Label : With lParticipantClock
                .Name = "participantClock" & indexCounter
                .Size = New Size(100, 20) : .Location = New Point(139, (5 + ((indexCounter - 1) * 26)))
                .BorderStyle = BorderStyle.Fixed3D : .TextAlign = ContentAlignment.MiddleRight
            End With : CenterPanel.Controls.Add(lParticipantClock)

            btnParticipantStop = New Button : With btnParticipantStop
                .Name = "ParticipantStop" & indexCounter
                .Size = New Size(58, 20) : .Location = New Point(245, (5 + ((indexCounter - 1) * 26))) : .Cursor = Cursors.Hand
                .BackColor = Color.Red : .ForeColor = Color.White : .Font = New Font(.Font, FontStyle.Bold) : .Text = "Stop"
                AddHandler .Click, AddressOf _ParticipantButtons_Click
            End With : CenterPanel.Controls.Add(btnParticipantStop)

            tmrParticipantTimer = New Timer : With tmrParticipantTimer
                AddHandler .Tick, AddressOf _ParticipantTimers_Tick
                .Interval = 1 : .Start()
            End With
        Next
    End Sub

    Private Sub _ParticipantButtons_Click(sender As System.Object, e As System.EventArgs)
        CType(sender, Button).Text = "done"
    End Sub
    Private Sub _ParticipantTimers_Tick(sender As System.Object, e As System.EventArgs)
        Static iCounter As Integer = -1
        iCounter += 1
        For i As Integer = 1 To iTotalParticipants
            If Not CType(CenterPanel.Controls("ParticipantStop" & i.ToString), Button).Text = "done" Then
                CType(CenterPanel.Controls("participantClock" & i.ToString), Label).Text = iCounter.ToString("00:00:00")
            End If
        Next
    End Sub
End Class

Could Not use StopWatch.Value for some odd reason.

thedonedeal commented: This is EXACTLY what I was aiming for :). Now I just need to learn what the syntax does as I haven't seen it before. +2
codeorder 197 Nearly a Posting Virtuoso

>>But Stopwatches cannot have a Tag component according to VB.
Why not create a Array that stores something similar to a .Tag for the StopWatches and ReDim the Array each time you create them?

codeorder 197 Nearly a Posting Virtuoso

Since your recent post and only wanting the lines that contain a .tif image, see if this helps.

Imports System.IO
Public Class Form1
    Private arlFileLines As New ArrayList
    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        Dim fbd As New FolderBrowserDialog '// declared in code, easier to manage.
        If fbd.ShowDialog = Windows.Forms.DialogResult.OK Then '// send all .txt files for evaluation.
            MsgBox("File lines containing images: " & getFileLinesCount(Directory.GetFiles(fbd.SelectedPath, "*.txt", SearchOption.AllDirectories)))
        End If
        '// FOR.TESTING/ETC.
        'If Not arlFileLines.Count = 0 Then
        '    For Each itm As String In arlFileLines
        '        MsgBox(itm)
        '    Next
        'End If
    End Sub
    Public Function getFileLinesCount(ByVal selCoolFiles() As String) As Integer
        arlFileLines.Clear()  '// reset to store non.duplicate lines.
        For Each selFile As String In selCoolFiles '// loop thru all found.files.
            For Each line As String In File.ReadAllLines(selFile) '// loop thru each file's lines.
                If line.Contains(".tif") Then
                    line = line.Substring(line.IndexOf("\") + 1, line.IndexOf(".tif") + 3 - line.IndexOf("\")) '// get .tif image from line.
                    If Not arlFileLines.Contains(line) Then arlFileLines.Add(line) '// if ArrayList does Not contain line, add.line.
                End If
            Next
        Next
        Return arlFileLines.Count
    End Function
End Class

>>Can you simplify my code or any suggestions?
I managed to do a little code clean up and added a Sub to save each file.

Public Function GetCountofTifString(ByVal iFolder As String) As Integer
        Dim intPos As Integer, strName As String = ""
        For Each tpath As String In Directory.GetFiles(iFolder, "*.txt", SearchOption.AllDirectories)
            intPos = (iFolder.LastIndexOfAny("\")) + 1
            strName = iFolder.Substring(intPos, (Len(iFolder) - intPos))
            Dim basa As New StreamReader(tpath)
            If …
codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Dim myFolder As String = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) & "\.vb.net\"
        MsgBox(IO.Directory.GetDirectories(myFolder)(0).ToString) '// folder.1.
        MsgBox(IO.Directory.GetDirectories(myFolder)(1).ToString) '// folder.2.
codeorder 197 Nearly a Posting Virtuoso

Let me know how it goes and if no results on your part, notify .Me and I'll post the solution.
.btw, ArrayLists are just like ListBoxes.
Instead of ListBox1.Items.Add("something"), you only use myArrayList.Add("something"), w/out the ".Items".

codeorder 197 Nearly a Posting Virtuoso

1.Add a ArrayList.
2.Clear it before loading your files.
3.Loop thru each line in each file and check if the ArrayList.Contains(file.line); If Not, add to ArrayList.
4.Get count of files in folder and compare to Arraylist.Count.
5.:)

codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Imports System.IO
Public Class Form1
    Private myFolder As String = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) & "\"

    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        With New FolderBrowserDialog
            If .ShowDialog = Windows.Forms.DialogResult.OK Then
                If getFileLinesCount(myFolder & "V20.txt") + getFileLinesCount(myFolder & "V23.txt") = getTifFilesCount(.SelectedPath) Then
                    MsgBox("=")
                Else : MsgBox(":(")
                End If
            End If
        End With
    End Sub
    Public Function getTifFilesCount(ByVal selFolder As String) As Integer
        If Directory.Exists(selFolder) Then Return Directory.GetFiles(selFolder, "*.TIF", SearchOption.AllDirectories).Length Else Return 0
    End Function
    Public Function getFileLinesCount(ByVal selFile As String) As Integer
        If File.Exists(selFile) Then Return File.ReadAllLines(selFile).Length Else Return 0
    End Function
End Class
codeorder 197 Nearly a Posting Virtuoso

I'm completely confused about this issue.
Are you trying to compare 2.files that contain file.paths of your 2.folders(1.file for each folder), and If similar file.names to Not count them?

codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        With TextBox1
            If Not .Text = "" Then '// check if not empty.
                Dim myCoolIDletters As String = "" '// new String to get all letters at beginning of ID.
                For i As Integer = 0 To .Text.Length - 1 '// loop until all letters located and added to String.
                    If Not IsNumeric(.Text(i)) Then myCoolIDletters &= .Text(i) Else Exit For
                Next
                '// set letters back and increase the #+1, with the format of 4#'s, as "0000".
                .Text = myCoolIDletters & (CInt(.Text.Substring(myCoolIDletters.Length)) + 1).ToString("0000")
            End If
        End With
    End Sub
codeorder 197 Nearly a Posting Virtuoso

Main reason is your code order; and no, it's not me:D, it's your code.

You have decSelection = Convert.ToDecimal(strSelection) before your Select Case , Not after.

codeorder 197 Nearly a Posting Virtuoso

I have no idea either how to delete internet.cache; been trying all morning w/google.results and no luck.:(

codeorder 197 Nearly a Posting Virtuoso

Suggestion: Have you tried clearing out the cache every so often during your process?

codeorder 197 Nearly a Posting Virtuoso

I have no idea(s) regarding "network.share", though here is a suggestion.
Have a small sidekick.app installed on each user's p.c., that does the "copy and overwrite the existing application executable in the program files\app directory".

I'm not sure how systems work with network.sharing, though there should be a folder somewhere, where everyone can access it.
If it does, load a simple .txt file in there, saying that there is a new.version and load your updated.exe in there also.

If their app. finds this file, Then to load the little sidekick.app, close it's self, and have the sidekick app do all the leg.work.

codeorder 197 Nearly a Posting Virtuoso

>>Bah, so any one with a problem with memory leak your just saying give up coding =/ ...
Why Not?if they can't fix the issue.
.just makes the programs I download/use work better.

codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Public Class Form1
    Private urlMain As String = "http://www.algebrahelp.com/calculators/equation/"
    Private sMain, arContent() As String, iSi, iEi As Integer

    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        WebBrowser1.Navigate(urlMain)
    End Sub

    Private Sub WebBrowser1_DocumentCompleted(sender As System.Object, e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
        With WebBrowser1
            TextBox2.Text = .Url.AbsoluteUri
            If .Url.AbsoluteUri = urlMain Then '// check if correct.url.
                With .Document
                    .GetElementById("equation").SetAttribute("value", TextBox1.Text)
                    .GetElementById("solvf").SetAttribute("value", ComboBox1.Text)
                    .GetElementById("equationForm").InvokeMember("submit")
                End With
            End If
            If .Url.AbsoluteUri.StartsWith(urlMain) AndAlso .Url.AbsoluteUri.Length > urlMain.Length Then
                sMain = .Document.Body.InnerHtml  '// your html.source.
                If sMain.Contains("<PRE>") Then
                    iSi = sMain.IndexOf("<PRE>") + 5 '// locate your start.point.
                    iEi = sMain.IndexOf("</PRE>", iSi) '// locate end.point.
                    arContent = sMain.Substring(iSi, iEi - iSi).Split(vbCrLf) '// .Split content to get lines.
                    sMain = ""
                    For Each itm As String In arContent '// loop thru all lines of content.
                        If Not sMain = "" Then sMain &= "<br />" & itm Else sMain = itm '// add "<br />" for the wb to recognize it as a new.line.
                    Next
                    .DocumentText = "<div style=""font-family:Verdana;font-size:14px;""><hr />" & sMain & "<hr /></div>" '// get results.
                End If
            End If
        End With
    End Sub
End Class

.btw, I cannot get the answer for "1+1" on that page:(; care to help me in Return and let me know the answer?since I've been trying to figure that out for years.
Thanks in advance.

codeorder 197 Nearly a Posting Virtuoso

Replace line.10 with this.

If arFileLines(i2).StartsWith(sToLookFOr) Then 
msgbox("this line is invalid: " & i2.tostring)
 Return False '// if not done w/the total of lines Then Return False.
End If

+= Glad I could help.:)

codeorder 197 Nearly a Posting Virtuoso

This should take care of the issue.

Private arFileLines(), sToLookFOr As String
    Private Function isFileValid(ByVal selCoolFile As String) As Boolean
        arFileLines = IO.File.ReadAllLines(selCoolFile) '// read file into array.
        sToLookFOr = "002"
        For i As Integer = 0 To arFileLines.Length - 1 '// loop thru all file lines, starting w/the second line.
            If arFileLines(i).StartsWith(sToLookFOr) Then '// check if current line startsWith your string to look for.
                '// get total of items"CInt(...)" following the line and loop thru the next lines until total.
                For i2 As Integer = i + 1 To i + CInt(arFileLines(i).Substring(12, 5))
                    If Not i2 > arFileLines.Length - 1 Then
                        If arFileLines(i2).StartsWith(sToLookFOr) Then Return False '// if not done w/the total of lines Then Return False.
                    Else
                        Return False '// if last line is missing.
                    End If
                Next
            End If
        Next
        Return True '// since it did not Return False, it can only be a valid File.
    End Function
renzlo commented: Very helpful man. +3
codeorder 197 Nearly a Posting Virtuoso

Use a Try/Catch for each itm and If you still get results, Then it is just that specific item that is not formatted properly.

For Each itm As ListViewItem In itms '// loop thru all itms in Array.
            Try
                With itm.SubItems(1).Text '// check Column2.Text
                    If CInt(.Substring(0, .IndexOf("/"))) = CInt(selCoolMonth) Then '// get all text prior to the first "/".
                        selCoolListView.Items.Add(itm) '// if a match, add to ListView.
                    End If
                End With
            Catch ex As Exception
                ' MsgBox(ex.Message)
            End Try
        Next
codeorder 197 Nearly a Posting Virtuoso

>>i can find no way to stop the increase. its impossible!
I can. Just don't use your .app.:D

codeorder 197 Nearly a Posting Virtuoso

Just overlooked the post you made and am wondering.

Do you want to check lines that start w/"002", get the total from end of line, and count "the following" lines until it validates against the total from end of line? Then go to next line w/"002" and validate again?

codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Public Class Form1

    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        'MsgBox("File is valid = " & validateFile(Environment.GetFolderPath(Environment.SpecialFolder.Desktop) & "\test.txt"))'// FOR.TESTING.
        With New OpenFileDialog
            .Title = "select a cool file"
            .Filter = "Text File|*.txt"
            If .ShowDialog = Windows.Forms.DialogResult.OK Then '// check if ok.clicked.
                MsgBox("File is valid = " & validateFile(.FileName))
            End If
        End With
    End Sub

    Private arFileLines(), sToLookFOr, sTotal As String, iGoodLine, iBadLine As Integer
    Private Function validateFile(ByVal selCoolFile As String) As Boolean
        arFileLines = IO.File.ReadAllLines(selCoolFile) '// read file into array.
        With arFileLines(0) '// with first line.
            sToLookFOr = .Substring(0, 3) : sTotal = .Substring(12, 5) '// read line and set the values.
            iGoodLine = 1 : iBadLine = 0 '// reset counters; iGoodLine=1 Not 0, since it read the first line.
        End With
        For i As Integer = 1 To arFileLines.Length - 1 '// loop thru all file lines, starting w/the second line.
            With arFileLines(i)
                If Not .StartsWith(sToLookFOr) Then iBadLine += 1 Else iGoodLine += 1 '// add points as needed.
            End With
        Next
        'MsgBox(iGoodLine & "." & iBadLine)
        If CInt(sTotal) = iGoodLine Then Return True Else Return False '// validate total from line 1 against all found good lines and return as needed.
    End Function
End Class

...and thanks for the defined.details.:)

codeorder 197 Nearly a Posting Virtuoso

I'll try to help, though you have to provide some defined.details, one thing at a time.

codeorder 197 Nearly a Posting Virtuoso

If you just need to change the content of the WebBrowser with yours Then check out this post.

codeorder 197 Nearly a Posting Virtuoso

Add this to Form1_Load , just after you setCoolListViewItemsInArray(ListView1) .

ComboBox1.SelectedIndex = 1 '// select 2nd item in ComboBox.

This will trigger the _ComboBox1_SelectedIndexChanged and cause it to fire off the code within.

.btw, welcome to the forum AndAlso glad I could help.:)

codeorder 197 Nearly a Posting Virtuoso

"web.host provider" is someone as justhost.com, my web.host provider.

I did a quick google search and located this:

If you try to upload some file of more than 4 mb you will get and error. This is the default file size limit of dot net. This is defined in Machine.config. You can overwrite this in web.config. Like this...

http://www.eggheadcafe.com/community/asp-net/17/10297761/error-on-fileupload-contorl.aspx

For future references, If regarding ASP.NET, Then post on the ASP.NET forum.

Hope this helps.:)

codeorder 197 Nearly a Posting Virtuoso

Since already in my code.snippets, see if this helps.:)

Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        TextBox1.Text = getCoolHttp("http://www.daniweb.com/members/codeorder/811140")
    End Sub

    Private Function getCoolHttp(ByVal selCoolUrl As String) As String
        Me.Cursor = Cursors.WaitCursor
        Try
            Dim myResponse As Net.HttpWebResponse = Net.HttpWebRequest.Create(selCoolUrl).GetResponse '// connect.
            Dim myStream As IO.Stream = myResponse.GetResponseStream() '// get.
            Dim myReader As New IO.StreamReader(myStream) '// read.
            Dim webContent As String = myReader.ReadToEnd
            myReader.Close() : myStream.Close() : myResponse.Close()
            Me.Cursor = Cursors.Default
            Return webContent
        Catch ex As Exception
            Me.Cursor = Cursors.Default
            MsgBox("Connection Error.", MsgBoxStyle.Critical)
            Return Nothing
        End Try
    End Function
codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Public Class Form1
    Private itms() As ListViewItem '// stores itms from ListView.

    Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        With ComboBox1.Items : For i As Integer = 1 To 12 : .Add(CStr(i)) : Next : End With '// load cmb(ComboBox).
        With ListView1.Items
            .Add(New ListViewItem("1,01/02/03".Split(",")))
            .Add(New ListViewItem("1,01/04/03".Split(",")))
            .Add(New ListViewItem("1,01/02/03".Split(",")))
            .Add(New ListViewItem("1,02/02/03".Split(",")))
            .Add(New ListViewItem("1,03/04/03".Split(",")))
            .Add(New ListViewItem("1,02/02/23".Split(",")))
        End With
        setCoolListViewItemsInArray(ListView1) '// IMPORTANT: after loading the ListView w/.Items, always set this.
    End Sub
    Private Sub setCoolListViewItemsInArray(ByVal selCoolListView As ListView)
        ReDim itms(selCoolListView.Items.Count - 1) '// reset the lenght of Array to lv.Items.Count
        For i As Integer = 0 To selCoolListView.Items.Count - 1
            itms(i) = selCoolListView.Items(i) '// set each array.itm as the appropriate lv.itm.
        Next
    End Sub

    Private Sub _ComboBox1_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
        With ComboBox1
            If Not .Text = "" Then filterCoolListView(ListView1, .Text)
        End With
    End Sub
    Private Sub filterCoolListView(ByVal selCoolListView As ListView, ByVal selCoolMonth As String)
        selCoolListView.Items.Clear() '// clear for new input.
        For Each itm As ListViewItem In itms '// loop thru all itms in Array.
            With itm.SubItems(1).Text '// check Column2.Text
                If CInt(.Substring(0, .IndexOf("/"))) = CInt(selCoolMonth) Then '// get all text prior to the first "/".
                    selCoolListView.Items.Add(itm) '// if a match, add to ListView.
                End If
            End With
        Next
    End Sub
End Class

I tried using ListView.ListViewItemCollection , though it kept clearing the Collection every time I cleared the ListView; very odd.

codeorder 197 Nearly a Posting Virtuoso

Could be that some servers do Not allow files to be uploaded If greater in size than 4MB. Check w/your web.host provider.

codeorder 197 Nearly a Posting Virtuoso

Use a .Substring.

Private sMain As String, iSi, iEi As Integer
    Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        sMain = "abcd<pre>some calculation here</pre>efg" '// your html.source.
        iSi = sMain.IndexOf("<pre>") + 5 '// locate your start.point.
        iEi = sMain.IndexOf("</pre>", iSi) '// locate end.point.
        MsgBox(sMain.Substring(iSi, iEi - iSi)) '// get results.
    End Sub
codeorder 197 Nearly a Posting Virtuoso

>>Any last tips...
:(

codeorder 197 Nearly a Posting Virtuoso

No memory.leak prior to the recently posted code?or the memory.leak was always there?
In any case, I provided what I know as a hobbyist vb.noob, good luck from here on out.:)

codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Private sInnerHtml As String
    Private Sub WebBrowser1_DocumentCompleted(sender As System.Object, e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
        sInnerHtml = WebBrowser1.Document.Body.InnerHtml
        With sInnerHtml.ToLower
            If .Contains("=""subject""") AndAlso .Contains("=""message""") AndAlso .Contains("=""btnSubmit""") Then
                '// run code here to post.
            End If
        End With
    End Sub

.might need a space here and there, though it should take care of the issue of Not using a Timer.

codeorder 197 Nearly a Posting Virtuoso

Thanks for input.
If thread solved, mark as Solved; best of luck and welcome to the forum.:)

codeorder 197 Nearly a Posting Virtuoso
With New SaveFileDialog
            .Filter = "Text Files (*.txt)|*.txt"
            .Title = "Save"
            If .ShowDialog = Windows.Forms.DialogResult.OK Then
                IO.File.WriteAllText(.FileName, TextBox1.Text)
                '// RichTextBox.
                'RichTextBox1.SaveFile(.FileName, RichTextBoxStreamType.RichText) '// change ".RichText" to ".PlainText" If needed.
            End If
        End With

If you still have this issue(should Not), reboot your system(could be an internal bug that needs to be squashed).

codeorder 197 Nearly a Posting Virtuoso
'// TextBox.
        IO.File.WriteAllText("full.path of file here", TextBox1.Text)
        '// RichTextBox.
        RichTextBox1.SaveFile("full.path of file here", RichTextBoxStreamType.RichText) '// change ".RichText" to ".PlainText" If needed.

Also, check if btnOk has been clicked before saving.

If SaveFile.ShowDialog = Windows.Forms.DialogResult.OK Then
            '// save :)
        End If
codeorder 197 Nearly a Posting Virtuoso

Start a new.project, add your wmp(WindowsMediaPlayer) to Form, Then modify code w/this.

Try
            '// wmp.code here.
        Catch ex As Exception
            MsgBox(ex.Message) '// displays error.msg and does not crash app.  error.msg is not necessarly needed.
        End Try

If you get an error.msg, post the result.

codeorder 197 Nearly a Posting Virtuoso

Should I build and design the entire project also?:D

Here are some notes.
Add your 4 wb's and add 4 Timers.
Other than that, good luck.:)

codeorder 197 Nearly a Posting Virtuoso

File.Content:

img1.png|sound1.wav
img2.png|sound2.wav
img3.png|sound3.wav
Imports System.IO
Public Class Form1
    Public myMediaFolder As String = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) & "\TEMP\"
    Private myMediaListFile As String = myMediaFolder & "myMediaList.txt"
    Private arMedia() As String, iTemp As Integer, rnd As New Random, chrMain As String = "|"

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        If File.Exists(myMediaListFile) Then arMedia = File.ReadAllLines(myMediaListFile) '// load file.
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If Not arMedia.Length = 0 Then
            iTemp = rnd.Next(0, arMedia.Length) '// get random #.
            With arMedia(iTemp)
                MsgBox(.Split(chrMain).GetValue(0) & vbNewLine & _
                       .Split(chrMain).GetValue(1))
            End With
        End If
    End Sub
End Class

Hope this helps.:)

codeorder 197 Nearly a Posting Virtuoso
codeorder 197 Nearly a Posting Virtuoso
Dim x As String = "http://sasqas.com/sadasd=sdasd"
        MsgBox(x.Substring(0, x.IndexOf("=") + 1)) '// 0=start.index, x.IndexOf...=Length
codeorder 197 Nearly a Posting Virtuoso

Since I cannot test it(no EA acct.), Not much at all I can do about it. Wish you luck and glad that I could be of help so far.:)

q.q.(quick.question)
Have you tested to see If it still has the memory leak?

.idea/suggestion.
Have you tried this w/multiple WebBrowsers?

codeorder 197 Nearly a Posting Virtuoso

.Replace the entire _WebBrowser1_DocumentCompleted event w/this.

Private Sub _WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
        If isSendingPMSxD Then
            Application.DoEvents()
            tmrWb.Start()
        End If
    End Sub

    Private WithEvents tmrWb As New Timer With {.Interval = 500}
    Private Sub _tmrWb_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles tmrWb.Tick
        Static iTimeOut As Integer = 0
        If Not iTimeOut = 3 Then '// roughly 1.5 sec.
            iTimeOut += 1
            Exit Sub
        Else
            iTimeOut = 0 '// reset timeOut.
            tmrWb.Stop() '// stop timer.
            With WebBrowser1.Document
                .GetElementById("subject").SetAttribute("value", TextBox3.Text)
                .GetElementById("message").SetAttribute("value", TextBox4.Text)
                .GetElementById("btnSubmit").InvokeMember("click")
            End With
            Label4.Text = iStartID
            If Not iStartID = iEndID Then
                iStartID += 1 : wbNavigate(iStartID) : Exit Sub
            Else
                isSendingPMSxD = False
                MsgBox(".done.")
                Button3.Enabled = True
            End If
        End If
    End Sub

I added a Timer to give it a TimeOut. Set the Timer's.Interval as needed, If needed.

quick.suggestion before .Replacing the event:
.Add "Application.DoEvents()" as the very first line of code in the wb.doc.completed event. Might or might Not Return results.
---
>>Cant check memory leak due to this fella.
If "this fella" is Waldo, I'll never get an answer, cause I can never find his butt anywhere.:D

codeorder 197 Nearly a Posting Virtuoso

Can you provide more details?
.btw, did it take care of the "memory increase leak"?

codeorder 197 Nearly a Posting Virtuoso

>>all i want is to random pictures and the sounds associated on that pictures will be played...
How do you plan to add the images and sounds to get recognized?
.From a File?.From My.Resources?.Full.Paths coded into your app.?