Multi-Threading For Searching Files In Folder?

Feb 15, 2012

Having a bit of an issue with my file.scanner and that issue is that I cannot figure out how to run multi.threading when searching the files within a folder(8,000+ files).

Imports System.IO
Module x
Function xGetFolderFilesCount(ByVal selFolder As String) As Integer

[Code].....

View 1 Replies


ADVERTISEMENT

Searching A Folder For Audio Files And Adding That Folder To An Array?

Aug 23, 2010

So I've been using some code to generate directories and such in a custom treeview, but am looking to expand upon this idea. While it's not using recursive functions, and only calls functions when expanding levels, I'm not quite sure how to put some of these together.find a way to just search through all folders on the PC. If the folder contains audio files, that folder is than added to an array (searching a folder for audio files and adding that folder to an array is done). It's just recursivly searching all folders on the PC.Here is the code I've been using for the treeview (I'm not sure if it can be adapted):

Public Function ListAllDrives() As String()
Dim arDrives() As String
arDrives = Directory.GetLogicalDrives()[code].....

View 4 Replies

Asp.net - Searching Particular Files In The Folder?

Jan 13, 2012

I can search all the images with .jpg extension and pass it to the fancybox gallery , The issue is i just want the images of particular productid for instance if a product has 5 images , and they are saved as (productid_imagenumber.jpg) , therefore a product with productid 99 will be saved as 99_1.jpg , 99_2.jpg similarly 99_5.jpg,I can pass the productID but i cant find a away just to get the images of that productID , instead of getting all the images which is done by the function below:

Dim directory As DirectoryInfo = New System.IO.DirectoryInfo("C:Images")
Dim allImages() = directory.GetFiles("*.jpg", SearchOption.AllDirectories)
Dim strContent As String = ""
For Each image As FileInfo In allImages

[code].....

View 1 Replies

Searching For Files In Folder

Nov 29, 2011

im using the following lines to search for zip files in a folder i need to update this to allow searching for .zip, .txt, .evt and .rar files now

[Code]...

View 8 Replies

Searching In Text Files In A Folder ?

Oct 17, 2009

I'm trying to create a folder search operation. The folder will have several text files (.txt), and user will specify the folder path and a search string, and the program will search the exact string within the text files which are located in the specified folder, and show the files. So far I've done nothing. I don't know how I can do folder operations with vb.net. a link to reading material.

View 1 Replies

Selecting Dynamic Folder When Searching For Files?

Feb 27, 2012

I have a file search that I want the user to select the folder they are searching the file in. At the moment I have
If Check.Text = "Correct" Then
If My.Computer.FileSystem.FileExists("C:Systemsfile.txt") Then
1CheckBox.Checked() = True
Else
1CheckBox.Checked = False
End If

However this check will be used for various files and its not usable if the FileExists directory stays the same ie searching the same folder and file for different records. I have a FolderBrowseDialog that I want the user to select the folder first in where to search and then within this chosen folder the static file will be checked. I have this as my folderbrowsedialog:

Dim Browser As New FolderBrowserDialog
Browser.Description = "Please select ."
Browser.ShowNewFolderButton = False
Browser.RootFolder = "c:"
Browser.SelectedPath = "c:windows"
If Browser.ShowDialog = Windows.Forms.DialogResult.OK Then
Me.text.Text = Browser.SelectedPath
End If

I tried adding in this code to the actual file check to encoporated the dynamic folder search but its bringing up errors and not working, I have this:
Dim path As String = "Browser"
Dim f As ReadOnlyCollection(Of String) = My.Computer.FileSystem.GetFiles("test.xlsx")
If My.Computer.FileSystem.FileExists("test.xlsx") Then
Box.Checked() = True

View 3 Replies

VS 2008 Multi-threding - Adding Multi-threading Facilities - Cross-thread Operation Not Valid

Feb 10, 2010

I'm adding multi-threading facilities for the first time. I have a function that is wrapped to be run in a separated thread. This function retrieves data (text) from a combobox and it works for sure without multi-threading.

When I call it as multi-threaded, I get the following error when I try to retrieve the data from the cmobobox: Cross-thread operation not valid: Control 'cmb1stBL' accessed from a thread other than the thread it was created on.

It looks like a restriction of thread-safety... I assume that the child thread cannot read from his parent, to make sure that he doesn't change his parent data. So how can I read the data from the combobox? Should I read the comoboxbox data before calling the child thread?

View 4 Replies

Accessing Multiple Sites Multi-threading Or Multi Browsers?

May 14, 2011

I have a need to build an app that will access about 10 websites and pass data to them, etc.I've read about something called multi-threading when searching Google. I've also seen people say that they use multiple browsers.Which route is better to use? I figure if you have to do some sort of multi-threading that you would access a single browser?

View 2 Replies

VB Code For A Function With Filesystemobject To Get The File Names When Searching In A Folder For Text Files?

Apr 30, 2009

I need code for the function filesystemobject which gets the text files from a folder when searched for.

View 1 Replies

Multi-threading Or Multi Browsers?

May 14, 2011

I have a need to build an app that will access about 10 websites and pass data to them, etc.I've read about something called multi-threading when searching Google. I've also seen people say that they use multiple browsers.Which route is better to use? I figure if you have to do some sort of multi-threading that you would access a single browser?Not sure which way I should approach this app.

View 2 Replies

Best Way Of Multi-threading?

Mar 3, 2009

I need to be able to call a C++ dll that takes a long time (possibly infinte, it relies on user input)to execute. Im calling this through VB. My VB GUI freezes up when this happens, and I would like to keep the GUI responsive, so that the user can stop this possibly infinte loop. A bit of background, the C++ is trying to keep score on a snooker table using a webcam, and while the VB scoreboard updates easily, I would like to script it so that the analysis is almost continuous, while still allowing the user to interact. Currently the project requires the user to press a button to start the shot analysis, but it would be preferable if the program scripted itself. I have only realised this problem now and the deadline is very soon.

Update: Our lecturer suggested an option to solve the problem, but it would appear that most options here and the one he suggested will not work for us as the processing time required for the webcam image capture is too great to handle due to hardware constraints.

View 5 Replies

SMS Multi Threading

Jun 26, 2009

SMS Multi Threading

View 4 Replies

.NET Perform Any Multi-threading On Its Own?

May 30, 2009

I know .Net and C# pretty well, but never even looked at VB.My problem is: our Win32 COM library is used by a number of clients, and we see that the number of failures is higher for those who use the library from VB (both VB and VB.NET) than for those who use C++, C# or Delphi. One thing about our library is that it is supposed to be used from one thread only - can some threading magic by VB be the cause of failures?

Clients tell us the do not create any extra threads on their own.

View 3 Replies

Better Performance With Multi Threading?

Feb 15, 2009

I'm creating a password hash recovery tool that uses brute force. I have the brute force algorithm run in a background worker. It all works, but some similar apps I tried out have performance ~100x bigger then my app. (mine does 50k keys/second, some others do 5m keys/second or more.)I realize this is partly caused by using a .Net language, but I suspect there are ways to significantly speed up the brute force. A lot of ppl say I should use multi threading, but how is this done in practice? Splitting up the passwords to check would slow down my app I think.

View 1 Replies

C# - .NET Multi Threading - Updating The UI On The Fly

Nov 12, 2010

I have a button click event and inside I do a lot of work. While I am doing this work (not from the UI project) I want to send messages to the UI to display to the user.

[Code]...

and inside DoMyWork which is in another assembly i can call SendMessage which writes to the textbox. The messages will only display though when DoMyWork is complete. How can I update TextBox1.Text on the fly without putting DoMyWork on a BackGround thread or do i have to put it on a BackGround thread? I do actually want to block the user from doing anything while DoMyWork is running

View 9 Replies

C# - Multi Threading A Web Application?

Sep 9, 2009

I know there are many cases when it's best to multi thread an application but when is it best to multi thread a .net web Application?

View 5 Replies

Multi-threading In GUI Environment

Jun 22, 2010

I made a simple Form1, with Text.Box1 (starting value=1) and Text.Box2 (starting value = 100000), as shown in the attachment: I wanted that, when the Form loads,value of Text.Box1 keeps on increasing by 2 and value of Text.Box2 keeps on

[Code]...

View 1 Replies

Multi-Threading On Multiple CPU

Aug 20, 2009

One of our products consists of two different services:

- main service that launched at the startup of Wndows
- GUI that launched manualy when needed

GUI is representing data from main service.Main service starts X amount of threads that do some work and gether data.Some minor data and adresses to threads are stored in chache memory, so that GUI will have access to them.Everything works fine in 99% cases, but in some rare cases GUI do not display any data when used on machines with multiple processors (not milti-core). My guess is that it can't access the memory -> probably OS "decided" to run main service on one processor and GUI on another one.Is there any way to access the memory alocated for one processor from the service that runs on another processor?Or is there simple and secure way (same application will be also runing on single processor machines) to specify both services to run on the same processor?

View 4 Replies

Synchronization In Multi Threading In .net?

Sep 10, 2010

I have a question regarding the synchronization in multi threading.

I have a function called send which i am calling in a for loop for every data row.

This function creates threads to send emails to different people.

Public Sub send(ByVal Conn As Data.DataRow, ByVal job As Data.DataRow)
MyThread = New Thread(AddressOf Me.start)
MyThread.Start()
End Sub

But every thread created is writing to a log file at different points of time. So, there are very high chances that 2 threads write to the same file at the same time. So, do i need to use any kind of synchronization mechanisms here ? or is it fine without them ?

View 3 Replies

VS 2010 Having The Multi-Threading IP's?

Dec 11, 2010

I've been raking my brain for quite some time on this. Is there any way with VB.NET that I can use multiple IP's in one instance of a program? For example, I want to be able to navigate to a web page 10 times at once, with each one using a different IP. I want them to be parallel (multi-threaded) rather than going sequentially. Going sequentially, I could just do the action, change the IP, do the action, change the IP.

View 5 Replies

VS 2010 Multi Threading The Right Way?

Jan 10, 2012

I have a button and when it's clicked a HTTP request is sent out to a website to do a few things, but because its got to load the external resources it makes the interface frozen. I've moved the HTTP onto another thread using the follow

VB.NET Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim Thread1 As New System.Threading.Thread(AddressOf check_accounts)

[Code]...

When i want to update a label that is on my main form (from the check_accounts sub). I know that isn't the right way, but i have no idea what the right way is. All the documentation i can find is very (excuse me for this) nerdy and really doesn't offer much insight on how to incorporate it into a project.

I want to be able to have a numericupdown box that can let the user change the amount of threads they want to use. I assume more threads allow the http requests to be done faster and at the same time?Also if i wanted to pause the HTTP requests, would the best method to use be pausing the thread?

View 12 Replies

Adding Multi-threading To Application?

Jun 15, 2009

I am working on adding multi-threading to my application. I have done two applications using multi-threading following a tutorial of sorts, and modifying the code to "get my feet wet."

This is the first time I am trying multi-threading within my own application, and I feel I should be beyond this type of problem, but after a 3 hour search on the forums, I can not find a solution, so I am posting this thread.

The section of code with the error

vb.net
Imports System.Threading
Imports SldWorks
Imports SwConst

[Code]......

View 9 Replies

Class Updates And Multi-threading?

Aug 29, 2010

using multi-threading in my application.Basically what i am trying to do from within a form event is initiate a class instance and then run a function of that class (via a thread) that changes certain member values of that class.Those class member values are then used to update values on the main form.Ive created a simple example below but i cant seem to get it to work.The class values are not updating and im struggling to understand how this threading works.

Class FormMain
Private Sub BtnClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles myformbtn.Click()
Dim myFileCounter As New FileCounter()

[code]....

View 10 Replies

Difference Between Multi-threading Vs. Backgroundworker?

Apr 12, 2011

I'm creating an app that needs to navigate to multiple websites, logs me in and then submits my documentation.I've read that multi-threading can handle this task but then I've read something about backgroundworker.

View 1 Replies

Download File Using Multi-threading?

Dec 18, 2010

Download file using Multithreading

View 1 Replies

Multi Threading With Comm Object

Jun 20, 2012

We working with a Modem type interface that use's the Comm port for two way communication. The App starts and sets up the Comm port, and sends config info to the 'Modem'. Trick here is you have specific timing issues that need to be considered, and we got it all sorted, by using Threading.

You send The Config command to the modem and wait X ms for the confirmation reply (Single Byte), If no reply, send a Wake up command, wait X ms and send Config command again. Once confirmed that the modem is in config mode, send parameters, Waiting for confirmation of each one. Once config is set, send the 'Return to normal mode' command and wait for confirmation. [Code]

The SwitchModemMode sub runs under the Comms thread and not the main thread, like the Checkmodem sub at the top. Mostly because the Comms thread Raises the Data Event, which in turn calls the SwitchModemMode. Now because of that the Thread that is supposed to be checking for the input and setting the Flag, is actually the one waiting for the Flag to be set. And Yes App.DoEvents could solve it here, however that can/will mess with the Timing needed with these commands. I'm looking for how to pass the Raised event to the Main thread.

View 1 Replies

Multi-threading Bad File Name Or Number

Apr 18, 2012

I'm using VB2008 express under Windows XP.I have a complex program that processes digital maps. To speed things up I have started to use multiple threads.The program logs diagnostic information as it runs - a file is opened when the program starts, records are written (Printline) to it as required and it is closed when the program ends. All this worked fine until I introduced multiple threads.For the main program it still works fine - but if I try to print to the log file from the code in a started thread there is an IO exception "Bad file name or number". The number (1) is shown by the debugger and is correct.Does this mean that a file cannot be accessed by different threads without being opened and closed for each thread?

View 1 Replies

Multi-threading With SyncLock And Invoke?

Mar 5, 2009

Once again Invoke has come back to haunt me! I have an application that has some background threads, serial communications and obviously a GUI. Now, the serial ports received incoming messages as events and these get processed and incoming data is logged both to a file and also appended to a RTB in the GUI (done using Invoke if InvokeRequired is true).Now, under normal circumstances everything is super happy and runs quite nicely but when stressed I reach some sort of deadlock.

What happens is I have two methods AddOutput and RemoveOutput. These both sync over an object SyncOutput As Object. When messages are received on the serial port they are processed and depending on whether or not a response is required AddOutput is called. This adds out going messages to a dictionary which is then accessed by a thread and the messages are sent out. If an acknowledgement message is received then the corresponding message in the dictionary is removed.

[Code]...

View 2 Replies

Multi-threading, Safe Variable?

Oct 1, 2011

I have apps with multiple threads. I never have two threads that write to the same variable, but I do have situations where one thread writes to a variable and another reads from it.Is this safe, thread wise? (talking from an execution standpoint) The practice, seems to work fine, but I don't know what would happen if in the split second if one core was reading the variable, and the other was trying to write to it. Do I need to set up some form of lock out here?

View 4 Replies

Use Multi-threading Or Delegates In A Service ?

Nov 6, 2008

Whether i should use multi-threading or delegates in a service that i am writing. I have written a couple of services before (with multi-threading) but think that i could have done a better job of it. The service does not have a UI, it only needs to interact with a database and around 800 ip addresses. I just need advice on which way would be better in terms of efficiency, if for example i needed to send data to all 800 ip addresses at once.

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved