Click here to Skip to main content
15,887,304 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: Exchange 2010 - Out Of Office Rule Pin
Eddy Vluggen23-Jun-14 4:59
professionalEddy Vluggen23-Jun-14 4:59 
GeneralRe: Exchange 2010 - Out Of Office Rule Pin
Frosch1111123-Jun-14 9:02
Frosch1111123-Jun-14 9:02 
AnswerRe: Exchange 2010 - Out Of Office Rule Pin
Eddy Vluggen23-Jun-14 22:29
professionalEddy Vluggen23-Jun-14 22:29 
GeneralRe: Exchange 2010 - Out Of Office Rule Pin
Frosch1111124-Jun-14 21:08
Frosch1111124-Jun-14 21:08 
GeneralRe: Exchange 2010 - Out Of Office Rule Pin
Eddy Vluggen24-Jun-14 22:29
professionalEddy Vluggen24-Jun-14 22:29 
GeneralRe: Exchange 2010 - Out Of Office Rule Pin
Frosch1111124-Jun-14 22:53
Frosch1111124-Jun-14 22:53 
AnswerRe: Exchange 2010 - Out Of Office Rule Pin
Bernhard Hiller23-Jun-14 21:46
Bernhard Hiller23-Jun-14 21:46 
QuestionRunning Shared sub in new thread? Pin
Draco201321-Jun-14 6:11
Draco201321-Jun-14 6:11 
I seem to be having problems when trying to run the shared sub from another class in my form1 application. The code works flawless when its called directly but when i try to multi thread the controls on form1 will not update.


The shared function and sub

VB
Public Shared Function FileCount(PathName As String) As Long
        Try
            Dim FSO As New FileSystemObject
            Dim fld As Folder
            If FSO.FolderExists(PathName) Then
                fld = FSO.GetFolder(PathName)
                FileCount = fld.Files.Count
            End If
            Return FileCount
        Catch ex As DirectoryNotFoundException
        End Try
    End Function 'Calculate File Count

    Public Shared Sub StartNewScan(ByVal FilePath As String)
        Dim Allfile As String = "*.*"
        Dim FFcount As Long
        Dim MyFolderSize As Long
        Dim FullPath As String
        Using fse As New FindFiles.FileSystemEnumerator(FilePath, Allfile, True)
            Dim ien As IEnumerator(Of FileInfo) = fse.Matches().GetEnumerator()
            ien.Dispose()
            For Each fi As FileInfo In fse.Matches()
                FFcount += CStr(FileCount(fi.DirectoryName)).Length
                Form1.Label3.Text = CStr( "File Count:" & FFcount)
                MyFolderSize += fi.Length
                FullPath = fi.FullName
                Form1.Label4.Text = "File Path:" & FullPath
            Next
        End Using
    End Sub



I am trying to call the shared sub in form1 like so

VB
Dim StartSharedSub as new threading.thread(addressof Startnewscan)
startsharedsub.start()



I am aware of delegates and that it may be necessary in my case to use that to update my UI controls but I am confused how to implement it in my case.

thank you in advance
AnswerRe: Running Shared sub in new thread? Pin
Dave Kreskowiak21-Jun-14 6:47
mveDave Kreskowiak21-Jun-14 6:47 
General[Hiring] .Net Developer in NYC Pin
Victoria F19-Jun-14 10:32
Victoria F19-Jun-14 10:32 
GeneralRe: [Hiring] .Net Developer in NYC Pin
Dave Kreskowiak19-Jun-14 10:48
mveDave Kreskowiak19-Jun-14 10:48 
GeneralRe: [Hiring] .Net Developer in NYC Pin
Victoria F19-Jun-14 10:49
Victoria F19-Jun-14 10:49 
GeneralRe: [Hiring] .Net Developer in NYC Pin
Dave Kreskowiak19-Jun-14 10:51
mveDave Kreskowiak19-Jun-14 10:51 
GeneralRe: [Hiring] .Net Developer in NYC Pin
Victoria F19-Jun-14 10:53
Victoria F19-Jun-14 10:53 
GeneralRe: [Hiring] .Net Developer in NYC Pin
Eddy Vluggen20-Jun-14 0:32
professionalEddy Vluggen20-Jun-14 0:32 
Questionentity framework 6 don't resolve foreign key Pin
micheleroma16-Jun-14 22:31
micheleroma16-Jun-14 22:31 
AnswerRe: entity framework 6 don't resolve foreign key Pin
Eddy Vluggen17-Jun-14 7:36
professionalEddy Vluggen17-Jun-14 7:36 
GeneralRe: entity framework 6 don't resolve foreign key Pin
micheleroma19-Jun-14 9:18
micheleroma19-Jun-14 9:18 
GeneralRe: entity framework 6 don't resolve foreign key Pin
Eddy Vluggen20-Jun-14 8:09
professionalEddy Vluggen20-Jun-14 8:09 
AnswerRe: entity framework 6 don't resolve foreign key Pin
Nathan Minier29-Jul-14 6:07
professionalNathan Minier29-Jul-14 6:07 
QuestionHow to make FolderBrowserDialog in asp.net Pin
ven75311-Jun-14 20:54
ven75311-Jun-14 20:54 
AnswerRe: How to make FolderBrowserDialog in asp.net Pin
Richard MacCutchan11-Jun-14 21:25
mveRichard MacCutchan11-Jun-14 21:25 
AnswerRe: How to make FolderBrowserDialog in asp.net Pin
Pete O'Hanlon11-Jun-14 22:18
mvePete O'Hanlon11-Jun-14 22:18 
QuestionHow to get 32-bit .NET Framework InstallPath on a 64-bit machine? Pin
Frank W. Wu10-Jun-14 6:11
Frank W. Wu10-Jun-14 6:11 
AnswerRe: How to get 32-bit .NET Framework InstallPath on a 64-bit machine? Pin
Richard Deeming10-Jun-14 6:41
mveRichard Deeming10-Jun-14 6:41 

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.