You are viewing our Forum Archives. To view or take place in current topics click here.
VB.Net Programming Help
Posted:
VB.Net Programming HelpPosted:
Status: Offline
Joined: Dec 05, 201014Year Member
Posts: 368
Reputation Power: 15
Status: Offline
Joined: Dec 05, 201014Year Member
Posts: 368
Reputation Power: 15
I need to write a program where you use threads to add two numbers. I have no idea what I am doing, so help would be much appreciated. This is what I have so far:
Module Worker
Public t1 As New System.Threading.Thread(AddressOf Sum)
Public t2 As New System.Threading.Thread(AddressOf SumOfTwo)
Sub Sum()
Console.WriteLine("Sum of two numbers")
For index As Integer = 1 To 15
If index Mod 2 = 0 Then
Console.WriteLine(index)
t1.Sleep(2)
End If
Next
End Sub
End Module
Module Worker
Public t1 As New System.Threading.Thread(AddressOf Sum)
Public t2 As New System.Threading.Thread(AddressOf SumOfTwo)
Sub Sum()
Console.WriteLine("Sum of two numbers")
For index As Integer = 1 To 15
If index Mod 2 = 0 Then
Console.WriteLine(index)
t1.Sleep(2)
End If
Next
End Sub
End Module
#2. Posted:
Status: Offline
Joined: Apr 25, 201113Year Member
Posts: 1,295
Reputation Power: 55
Have you copied this code or have you done it yourself. Also can you give a little more info about your project
- 0useful
- 0not useful
#3. Posted:
Status: Offline
Joined: Oct 27, 201212Year Member
Posts: 10
Reputation Power: 0
Status: Offline
Joined: Oct 27, 201212Year Member
Posts: 10
Reputation Power: 0
bradanter96 wrote I need to write a program where you use threads to add two numbers. I have no idea what I am doing, so help would be much appreciated. This is what I have so far:You should really use the Microsoft VB express.
Module Worker
Public t1 As New System.Threading.Thread(AddressOf Sum)
Public t2 As New System.Threading.Thread(AddressOf SumOfTwo)
Sub Sum()
Console.WriteLine("Sum of two numbers")
For index As Integer = 1 To 15
If index Mod 2 = 0 Then
Console.WriteLine(index)
t1.Sleep(2)
End If
Next
End Sub
End Module
- 0useful
- 0not useful
#4. Posted:
Status: Offline
Joined: Nov 11, 201212Year Member
Posts: 74
Reputation Power: 4
Status: Offline
Joined: Nov 11, 201212Year Member
Posts: 74
Reputation Power: 4
That code is not right at all and as the guy above said, use vb.net express as it would make it simpler
- 0useful
- 0not useful
You are viewing our Forum Archives. To view or take place in current topics click here.