Click here to Skip to main content
15,905,420 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: control +C and control +V doesn't work on textbox controls. Pin
Christian Graus21-Dec-07 21:25
protectorChristian Graus21-Dec-07 21:25 
GeneralRefresh connection or port to Remote DB Pin
nishkarsh_k21-Dec-07 20:10
nishkarsh_k21-Dec-07 20:10 
GeneralRe: Refresh connection or port to Remote DB Pin
Dave Kreskowiak22-Dec-07 4:55
mveDave Kreskowiak22-Dec-07 4:55 
GeneralRe: Refresh connection or port to Remote DB Pin
nishkarsh_k22-Dec-07 20:48
nishkarsh_k22-Dec-07 20:48 
GeneralRe: Refresh connection or port to Remote DB [modified] Pin
Dave Kreskowiak23-Dec-07 4:21
mveDave Kreskowiak23-Dec-07 4:21 
GeneralPopulate ListView from TreeView Pin
ExcelMonkey21-Dec-07 6:00
ExcelMonkey21-Dec-07 6:00 
GeneralRe: Populate ListView from TreeView Pin
Dave Kreskowiak21-Dec-07 6:12
mveDave Kreskowiak21-Dec-07 6:12 
GeneralMultithreading Problem : Threads die before complete their assigned task Pin
Rupesh Kumar Swami21-Dec-07 2:42
Rupesh Kumar Swami21-Dec-07 2:42 
hi all,
i use multi threading in my application which perform the work of downloading file.
the following code Create the thread & start them
<br />
 Protected Sub DownloadFileInfo(ByVal sourcePath As String, ByVal DestinationPath As String)<br />
        If Not File.Exists(DestinationPath) Then<br />
            ReDim Preserve TotalThreads(TotalThreadCreated)<br />
            'ReDim Preserve WaitAllDownloadEvent(TotalThreadCreated)<br />
            Dim DownLoadObject As DownloadClass = New DownloadClass<br />
            TotalThreads(TotalThreadCreated) = New Thread(AddressOf DownLoadObject.StartDownload)<br />
            TotalThreads(TotalThreadCreated).Name = TotalThreadCreated.ToString<br />
            TotalThreads(TotalThreadCreated).IsBackground = True<br />
            'TotalThreads(TotalThreadCreated).<br />
            'WaitAllDownloadEvent(TotalThreadCreated) = New AutoResetEvent(False)<br />
<br />
            DownLoadObject.DownloadFileWithSourcePath1 = sourcePath<br />
            DownLoadObject.DownloadFileWithDestinationPath1 = DestinationPath<br />
            DownLoadObject.MyObjectNumber1 = TotalThreadCreated<br />
            TotalThreads(TotalThreadCreated).Start()<br />
            TotalThreadCreated += 1<br />
<br />
        End If<br />
    End Sub<br />
<br />


code of downloadClass is following

<br />
Imports system<br />
Imports System.Threading<br />
Imports System.IO<br />
<br />
Public Class DownloadClass<br />
    Public DownloadFileWithSourcePath1 As String<br />
    Public DownloadFileWithDestinationPath1 As String<br />
    Public MyObjectNumber1 As Integer<br />
<br />
<br />
    Sub StartDownload()<br />
        If Not File.Exists(DownloadFileWithDestinationPath1) Then<br />
            Try<br />
<br />
                My.Computer.Network.DownloadFile(DownloadFileWithSourcePath1, DownloadFileWithDestinationPath1)<br />
<br />
            Catch ex As Exception<br />
            End Try<br />
        End If<br />
<br />
    End Sub<br />
<br />
    <br />
End Class<br />
<br />


DownloadFileInfo procedure is called near about 175 times so total 175 thread is created and in Destination folder i can see the icon of all download files(during downloading).
but after some time (near about 2 minute), these 175 icon is decreased and only few icon are appearead (near about 40). I think all thread is died after 2 minute so file attached to these thread is also deleted (note that files is not completely download)

any body have idea where i am wrong ?
any help will be greatly appreciated.
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)

My Company

GeneralRe: Multithreading Problem : Threads die before complete their assigned task Pin
Dave Kreskowiak21-Dec-07 3:10
mveDave Kreskowiak21-Dec-07 3:10 
GeneralRe: Multithreading Problem : Threads die before complete their assigned task Pin
Rupesh Kumar Swami21-Dec-07 4:00
Rupesh Kumar Swami21-Dec-07 4:00 
GeneralRe: Multithreading Problem : Threads die before complete their assigned task Pin
MidwestLimey21-Dec-07 5:15
professionalMidwestLimey21-Dec-07 5:15 
GeneralRe: Multithreading Problem : Threads die before complete their assigned task Pin
Dave Kreskowiak21-Dec-07 6:09
mveDave Kreskowiak21-Dec-07 6:09 
GeneralRe: Multithreading Problem : Threads die before complete their assigned task Pin
MidwestLimey21-Dec-07 6:40
professionalMidwestLimey21-Dec-07 6:40 
Questionwildcard search [modified] Pin
BOREC21-Dec-07 0:43
BOREC21-Dec-07 0:43 
GeneralRe: wildcard search Pin
Dave Kreskowiak21-Dec-07 3:04
mveDave Kreskowiak21-Dec-07 3:04 
GeneralRe: wildcard search Pin
BOREC21-Dec-07 8:33
BOREC21-Dec-07 8:33 
GeneralRe: wildcard search Pin
Dave Kreskowiak21-Dec-07 9:07
mveDave Kreskowiak21-Dec-07 9:07 
GeneralRe: wildcard search Pin
Luc Pattyn21-Dec-07 15:34
sitebuilderLuc Pattyn21-Dec-07 15:34 
GeneralRe: wildcard search Pin
Dave Kreskowiak21-Dec-07 15:52
mveDave Kreskowiak21-Dec-07 15:52 
GeneralRe: wildcard search Pin
Luc Pattyn22-Dec-07 4:18
sitebuilderLuc Pattyn22-Dec-07 4:18 
GeneralRe: wildcard search Pin
ChandraRam23-Dec-07 22:31
ChandraRam23-Dec-07 22:31 
QuestionHow to add shape controls to pictuirebox in vb.net Pin
VB 8.021-Dec-07 0:36
VB 8.021-Dec-07 0:36 
AnswerRe: How to add shape controls to pictuirebox in vb.net Pin
Dave Kreskowiak21-Dec-07 1:56
mveDave Kreskowiak21-Dec-07 1:56 
GeneralRe: How to add shape controls to pictuirebox in vb.net Pin
VB 8.021-Dec-07 3:01
VB 8.021-Dec-07 3:01 
GeneralRe: How to add shape controls to pictuirebox in vb.net Pin
Dave Kreskowiak21-Dec-07 3:32
mveDave Kreskowiak21-Dec-07 3:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.