Results 1 to 6 of 6

Thread: How to open multiple IE? (Visual Studio 2008) (multithreading)

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2010
    Posts
    11

    How to open multiple IE? (Visual Studio 2008) (multithreading)

    what i did was i use a select statement in opening multiple IE just for testing but the main function is what you put number on a textbox then the number the IE's will open for example i put 100 on textbox then when i click a button then 100 IE's will open so if im going to use select statement when opening 100 IE my code will be crazy... heres my sample code..




    Code:
       
          Private Sub btnGenerate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGenerate.Click
       
          Dim num As Double
       
          Try
       
          num = txtNoOfMulti.Text
       
           
       
          Catch ex As Exception
       
          MsgBox("You Must Enter a Number", MsgBoxStyle.Exclamation)
       
          End Try
       
           
            Select Case num
      
           
      
          Case "1"
      
          System.Diagnostics.Process.Start("iexplore", "www.mail.yahoo.com")
      
          Case "2"
      
          System.Diagnostics.Process.Start("iexplore", "www.mail.yahoo.com")
      
          System.Diagnostics.Process.Start("iexplore", "www.mail.yahoo.com")
      
          Case "3"
      
          System.Diagnostics.Process.Start("iexplore", "www.mail.yahoo.com")
      
          System.Diagnostics.Process.Start("iexplore", "www.mail.yahoo.com")
      
          System.Diagnostics.Process.Start("iexplore", "www.mail.yahoo.com")
      
          Case "4"
      
          System.Diagnostics.Process.Start("iexplore", "www.mail.yahoo.com")
      
          System.Diagnostics.Process.Start("iexplore", "www.mail.yahoo.com")
      
          System.Diagnostics.Process.Start("iexplore", "www.mail.yahoo.com")
      
          System.Diagnostics.Process.Start("iexplore", "www.mail.yahoo.com")
      
          Case "5"
      
          System.Diagnostics.Process.Start("iexplore", "www.mail.yahoo.com")
      
          System.Diagnostics.Process.Start("iexplore", "www.mail.yahoo.com")
      
          System.Diagnostics.Process.Start("iexplore", "www.mail.yahoo.com")
      
          System.Diagnostics.Process.Start("iexplore", "www.mail.yahoo.com")
      
          System.Diagnostics.Process.Start("iexplore", "www.mail.yahoo.com")
      
          End Select
      
           
      
          End Sub

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: How to open multiple IE? (Visual Studio 2008) (multithreading)

    How do you usually do the same thing multiple times? With a loop. What type of loop is best for doing something a specific number of times? A For loop.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2010
    Posts
    11

    Re: How to open multiple IE? (Visual Studio 2008) (multithreading)

    i try the loop for this and for loop but the IE never stops poping... i think its a if else statement but i dont why... i think its something like this but i dont know the exact code
    Code:
     dim x as integer
    
    x =  System.Diagnostics.Process.Start("iexplore", "www.mail.yahoo.com")

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: How to open multiple IE? (Visual Studio 2008) (multithreading)

    Process.Start doesn't return an Integer. There's no use for an If...Else statement because that specifically tests a condition and does one thing if it's True and another if it's False, which is not what you want to do. A For loop is specifically for performing an action a specific number of times, which is what you want to do. Maybe you should show us your attempt at a For loop and we can help you fix it.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5

    Thread Starter
    New Member
    Join Date
    Jan 2010
    Posts
    11

    Re: How to open multiple IE? (Visual Studio 2008) (multithreading)

    im sorry but i dont have any idea.... please give me an idea.... on how to solve this.... thx in advance...

  6. #6
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: How to open multiple IE? (Visual Studio 2008) (multithreading)

    A For loop is one of the basic building blocks of VB.NET programming. If you have no idea how to use them then I suggest that you find yourself a tutorial and work through it to get the basics down before you try more adventurous things.

    http://www.homeandlearn.co.uk/NET/vbNET.html
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

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



Click Here to Expand Forum to Full Width