How To Get Filename Faster
Mar 29, 2010
I have a directory with more then 350.000 files in. I need to process every single file and move them to an other folder. When I use the dir() method it takes a few seconds before if it returns the first file found.
dim foundfile as string = dir("d:")
In the documentation there is this:
"The My.Computer.FileSystem Object gives you greater productivity and performance in file I/O operations than the Dir function. See My.Computer.FileSystem.GetDirectoryInfo Method for more information."
But I can't find any method that is faster then dir, and gives the same result. I can't use this method below because it takes for ever to load......
For Each foundFile As String In My.Computer.FileSystem.GetFiles("D:")
Next
It just does not work fast...
When I use the Dir() method it takes like 5 sec, and it uses 100% cpu... it is just not a option. How do I get the same function as the dir method but better performance? (I use visual basic 2008).
View 8 Replies
ADVERTISEMENT
Jul 1, 2009
Quick query...I'm trying to scan a long string and return any values that occur between the tags <FileName> and </FileName> I've got a bit of code here to use regular expressions to return the position of the occurunces of both substrings..Just wanted to find out if there is any way to scan for both substrings within one loop (as im currently doing 2, one for the first substring and one for the 2nd) so I can use something along these lines:
ringlist = Mid(XMLRESP, (startloc + 1), (endloc - 1))
MsgBox(ringlist)
to msg box the value between the substrings...either that or another approach to return the value between the 2 substrings (it can be of variable length)
Dim patternstart As String = "<FileName>"
Dim patternend As String = "</FileName>"
Dim matchesstart As MatchCollection = Regex.Matches(XMLRESP, patternstart)
[code].....
View 3 Replies
Oct 17, 2010
How would I do that? Sample code is below that demonstrated that the file I opened contained the full path and file name.
I want to extract just the path and serialize that to the user.config file as a UserSetting value. Then next time the user opens the dialog box, it uses that saved path string to go immediately to the location previously used.
If openFileDialog1.ShowDialog() = DialogResult.OK Then
Properties.Settings.Default.persistConnectionType = openFileDialog1.FileName
Properties.Settings.Default.Save();
[Code].....
View 3 Replies
May 27, 2009
I have a Listview on my form with different files. I can selet a file en open it with the proces start method. To open the file i use the OpenFileDialog method and select the filename. This work very good. With the code below.
My question is if there is a method to get the selected file without using the OpenFileDialog Box. So when i dubbelclick the selected file the proces will start with open the selected file. Something like:
proc.StartInfo.FileName = Me.SelectedCell.FileName
instead of proc.StartInfo.FileName = Me.OpenFileDialog1.FileName
PS) May be i can preduce the Filename using the OpenFileDialog method on the background.
Private Sub ListView1_MouseDoubleClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ListView1.MouseDoubleClick
If Me.OpenFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then
[Code]....
View 8 Replies
Jun 26, 2009
how do you transform an address like "file:///d:filename.ext" in "d:filename.ext"
without dirty string manipulation??
View 4 Replies
Oct 1, 2010
You'd think both are the same. But maybe it's the compiler that Microsoft has used, but I've noticed that when compiling two very small programs, identical logic. VB.NET uses more IL instructions.Is it true than that c# must be faster, if only because its compiler is smarter.
View 6 Replies
Feb 15, 2011
Possible Duplicate: Is C# faster than VB.NET? Which one is faster, C# or Vb.net ?
View 2 Replies
Mar 11, 2011
A long time a agp I settled into a listview as an indicating device. I do not use pictorial modes or graphics. Just listing and multicolumn listing.I am also a performance bug and I have written realtime monitors for monitoring cpu activity in real-time and normally rum them starting at bootime. Lately I have found that the listview throws away time. In a tight loop, the list view does not take all cpu time available and the listview is relatively slow.
Does anyone know of a control like the list views only it's faster? Multi-colored and multi-columned are musts.
View 5 Replies
Jun 22, 2010
I have a simple application, a form with two datepicker( Datepicker1 is for startsearchdate, while datepicker2 is endsearchdate) to filter out any record that not in the range. The source of the record is readed from a rtf file.The record is in format as showm below.[code]...
View 9 Replies
Mar 12, 2009
My co-worker said that in a previous interview, he learned that foreach is faster in VB.Net than c#'s foreach. He was told that this was because both have different CLR implementation.
Coming from a C++ perspective, I'm curious on why this is and I was told that I need to read up on CLR first. Googling foreach and CLR doesn't help me understand.
Does anyone have a good explanation on why foreach is faster in VB.Net than in c#? Or was my co-worker misinformed?
View 5 Replies
Apr 13, 2011
I create a CSV file by getting a datatable then looping through that datatable and writing eachline of a CSV file. My data source usually has around 65,000 rows in it. This process takes several minutes to download from the browser. The problem is that locally and on dev it doesn't take too long, but on the client they usually timeout.
Is there a faster way to generate this file?
Function GenerateCSVFile() As String
Dim stuPro As New studentProvider.StudentProvider
Dim emailCenter As New EmailCenter
[Code].....
View 5 Replies
Jan 5, 2010
I need to verify if a certain user exist on my asp.net site.I want to know if which of these two functions is more efficient, faster and better compared to each other and why.
[Code]...
View 6 Replies
May 23, 2012
I worked in a role and functioning properly. The problem is that it is a bit slow for use in many images would be very slow. I read online that with stride and scan0 and working in memory with buffer can be made faster, but i donīt understand anything . Does anyone know how it works or how to make my code run faster?
[Code]...
View 12 Replies
Apr 2, 2010
I'm converting a process from VB 6.0 to VB .Net. The process copies a table from one database table to another database. In many cases they are not linked so a "Select * into Table2 from Table1" is not a solution. Also the source table may be a temporary global table that has a unique structure. The current process reads the source table into an ADODB recordset, obtains the columns attributes to create a new table, creates the new table, builds insert statements from the source table, and then inserts the rows into the new table. I'd like to take advantage of any .Net features that may be more efficient than that. Can anyone point me in the right Direction?
View 1 Replies
Jun 22, 2010
I am loading images from the internet. I am using PictureBox1.imageLocation() but it takes a while to load the image. Is there a way i can load the images faster? it shows an error icon before it displays a picture...how can i get rid of that?
View 6 Replies
Nov 26, 2010
Im using RichTextBox from Visual Studio 2008 to show various RTF content and it is slow. I mean really slow. Is there any way to improve the loading speeds of LoadFile function?I tried to load directly from memorystream (without saving file to disk) but it's still slow.I read plenty info about how RichTextBox is slow and all. Has there been any improvements in Visual Studio 2010?
View 5 Replies
Dec 4, 2009
I'm receiving a lot of data at the rate of 19200. I'm using read byte to assemble a buffer and process it. When I receive certain data I need to reply to the sender. I noticed that my replies are not fast enough. So I did a test where I unplugged the sender and noticed I was still receiving data! That I found was because the serial port buffer still had data from the sender that I didn't process. Anyhow I'm using Visual Studio 2005, the serial port object. How can I process the data faster. Would something like SerialPort1.ReadExisting or ReadLine work faster?
View 4 Replies
Sep 23, 2011
I just wondering is there any faster way to save a data into a database. Lets just say i have a datagridview that contains 10,000 records. To save all of it you will use a loop right but it will take a several minutes or maybe a seconds. Same with a datatable right.
View 6 Replies
Dec 15, 2011
Is it possible to make a vb.net application faster Through code like using characters that the Computer already understands Like coding in certain areas through y x (math) etc. Will it be More faster since the compiler don't have to really do much work But its still must be VB.NET
View 19 Replies
Jun 13, 2010
Ok well i have a code that makes a bitmap the size of 9000,9000 but it makes the program run so slow. how to make it run faster?
View 5 Replies
Jun 27, 2012
*i have a vb.net application that plots 16 plots immediately, the plots data are realtime. the 16 plots must draw the points at the time they receive them (must be no delay), to do that 1- i made a timer with ticks at 50 ms.2- at each timer tick call the plotting function 16 times (with a graph name as parameter)like that:
[Code]...
View 1 Replies
Apr 24, 2010
What I'm trying to do is iterate through each pixel in a bitmap, and get the color value of each pixel.I've tried using .getpixel, but it's fairly slow. On a 640x480 image, it takes roughly .35 seconds to go through it. Which can add up if doing many pictures.
[Code]...
View 3 Replies
Aug 10, 2011
My application is very very speed esential and even a microsecond matters.I am using semaphore(1,1) at varios places. I think it can be easily converted into mutex.But I want to know if it will be advantageous or its one and the same thing as far as speed is concerned.
View 1 Replies
Feb 4, 2010
i have a program in VB.Net 2005 and my problem is that it runs very slow. I mean, it takes some time for the Form to be displayed even if it is not doing anything in the Form_Load event. Do all programs in VB.NET 2005 act like that? my programs in VB6 would display the Form instantly.
View 4 Replies
Apr 20, 2009
I would like to know how cam i go faster than 1 interval? [code]
View 6 Replies
Jan 19, 2012
im making a program to "test darwinism" in C++ and im showing the results in a VB 2010 express app, the results consist of .800x800 bmp files displaying creatures eating , reproducing and evolving. the VB app only has a picture box and it changes the .image param in a timer so that it looks like a video : for example it reads : frame0.bmp then frame1.bmp etc. I get about 30frames seconds with this method (and alot of GB of .bmp files..)the .bmp files are read slower if they never have been read.. for example I get about 5frames/sec when im using new .bmp files while I get 30fps if the files have been read once.. only opening and closing the files doesnt make them load faster, I have to load the bitmap image. I noticed that opening the directory where the .bmp files are and letting windows make preview icons make them load faster too.. that looks weird to me.. something with indexing ?also , my c++ program which creates the .bmp files goes really fast for the 500first but then it becomes slower (even if It just writes black .bmp files in a closed loop). could it be that the hard disc gets overwhelmed by all the writing ?
View 8 Replies
Sep 14, 2010
in my project I insert values into a database, each value needs to be unique, currently I am using the following code to check for the value in the database before inserting, if it exists I loop back and generate another value and check again..
Dim SerialCount As Integer
SerialCount = 0
Dim con As New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:UsersMatt-ASUSDocuments im_db.accdb;Persist Security Info=False")
[code]....
View 7 Replies
Mar 21, 2011
How to load asp.net webpages faster using .htaccess.what was the coding for .htaccess so that the webpages loads faster ..i have hosted my site on ...ixwebhosting
View 1 Replies
Feb 28, 2012
I was wondering how I can make this happen. I am making a app that basicallysite faster. I am using Visual Studio 2010 Ultimate. I have a text box that has some of these fields on the side:
|membersonly=
|power=
|gender=
[code].....
View 1 Replies
Aug 26, 2011
I'm monitoring a folder for Jpg files and need to process the incoming files. I decode the filename to get all the information I want and insert into a table and then move the file to another folder.
The file name is already contains all the information I want. Eg. 2011--8-27_13:20:45_MyLocation_User1.jpg.
Now I'm using Inser Statement
Private Function InsertToDB(ByVal SourceFile As String, ByVal Date_Time As DateTime, ByVal Loc As String, ByVal User As String) As Boolean
Dim conn As SqlConnection = New SqlConnection(My.Settings.ConString)
[Code]....
View 2 Replies