Creating Text Files To Slow - Any Alternative?

Oct 2, 2009

what i am doing is downloading headers from a web server using a tcpclient which works great the headers describe diffrent files and there are hundreads per file, if i download the headers and write them to a text file using a streamwriter it works great, but i need the headers to be in a text file depending on the name of the file in the header, so i need them grouped together, i am now using streamwriter to write the headers to seperate textfiles depending on the filename in the header but it is reallllyyyy slow for some reason, im not sure if it is because it has to load each file then write to it? i only have to append the new header to the end of the text file i dont have to open it up and read through it.

View 8 Replies


ADVERTISEMENT

VS 2008 Best Way To Display Large Text Files/Slow Controls?

Mar 24, 2009

I am new to VB.Net, but I can tell you so far I love programming. That said, I'm building a tool basically to parse and display simple plain text log files. I'm hitting one stumbling block that really has me frustrated.

Other tools are able to load huge log files (500MB even) in a number of seconds. My tool, basically hangs loading a file that is maybe 5MB.

I'm using the MyString = StreamReader.ReadToEnd to read the contents into a string, and then RichTextBox1.Text = MyString to display the contents. That said, I really want to display the contents in a datagrid, but there has to be a better way of doing this?

How can I get my application to load larger files and display them faster? What am I doing wrong?

View 7 Replies

Creating Text Files Containing Chr(13) And Chr(10)?

Jul 15, 2010

I am a beginner in vb 10 (vb.net). I am trying to create a text file "something.txt" and write a long string to the file. My string contains formatting chars newline and carriage return, which I want to keep.

I tried:
FileToSave.Write("test" & Chr(10) & Chr(13) & "test2", RichTextBoxStreamType.RichText)

using the System.IO.StreamWriter method but the line feeds and carriage returns are lost and all the text is just streamed together with no formatting.

Where 'FileToSave' is the path and name of the file. Note: I know I can use the vbnewline instead of chr(x) but this is not the issue.

View 1 Replies

Successful Winsock Program But Noticed That There Is Alternative Way Of Creating Connections

Mar 11, 2011

So I was looking around the forums for how to do a successful Winsock program but noticed that there is an alternative way of creating connections, using system.net.sockets. Would you guys say that system.net.sockets has replaced Winsock? Is there a particular one that is better than the other?

View 3 Replies

Creating A Series Of Text Files?

Jun 27, 2011

I am trying to write a program that writes information from texts boxes to a text file on the users hard drive. I would like to create a new text file if one already exists, for example if text1.text exists, it creates a new text file called text2.text, then if text2.text exists it creates text3.text and so on. Here is what I have so far:

[Code]...

I've tried fooling around with if statements to create a new file but it doesn't seem to be working. Additionally, How can I write to a new line in a text file. For example there are 4 text boxes and each string from each text box gets its own line.

View 1 Replies

VS 2010 Creating A Login & Sign Up Forum Using Text Files?

May 9, 2012

Ok, so today I wasted a bit of time looking for ways to use a text file to save login information. Basically, there are two fields, username and password, and two buttons, sign up and log in. When you click the log in button, I want it to verify the information entered in the fields, and when you click sign up, I want it to add the information to the file. It doesn't seem that difficult, but I'm have a lot of trouble finding a way to do it. I would be very grateful if I could find assistance with this on these forums.

P.S. If it was my decision it would obviously be using a database, but for this particular program I need to be using text files.

View 3 Replies

Creating A Reference To An Object In An IEnumerable Linq Query Would Be Really Slow?

Jun 18, 2009

Is there any particular reason why creating a reference to an object in an IEnumerable Linq query would be really slow? I have a Linq query list consisting of my own objects (count is about 200).I was doing a time-critical task, and this line (which was used a lot in a loop) took nearly a millisecond to execute:

Dim CurObject as MyClass = QueryResult(CurIndex)

View 2 Replies

Alternative To The C++ Command Of Set Active Window.text ?

Apr 17, 2009

Is there are VB.net alternative to the C++ command of set active window.text ? (its something like that) baisicly this command renames the active window to what ever you want, is VB.net powerful enough to do this?

View 3 Replies

File I/O And Registry :: Getting An Alternative To The File.Copy Method Of Copying Files?

Mar 27, 2009

I've got an app which uses a background worker to copy files. It works fine but some files are quite large and it "appears" as though the app isn't doing anything. Is there an alternative to the File.Copy method of copying files so I can report on the progress of individual file copies, like the percentage complete?

View 19 Replies

.net - Slow Performance When Utilizing Interop.DSOFile To Search Files By Custom Document Property?

Apr 19, 2010

I am new to the world of VB.NET and have been tasked to put together a little program to search a directory of about 2000 Excel spreadsheets and put together a list to display based on the value of a Custom Document Property within that spreadsheet file. Given that I am far from a computer programmer by education or trade, this has been an adventure.

I've gotten it to work, the results are fine. The problem is, it takes well over a minute to run. It is being run over a LAN connection. When I run it locally (using a 'test' directory of about 300 files) it executes in about 4 seconds.I'm not sure even what to expect as a reasonable execution speed, so I thought I would ask here.The code is below, if anyone thinks changes there might be of use in speeding things up.

Private Sub listByPt()
Dim di As New IO.DirectoryInfo(dir_loc)
Dim aryFiles As IO.FileInfo() = di.GetFiles("*" & ext_to_check)[code]....

View 1 Replies

VS2010 .NET And Windows 7 Access Denied On Writing To Or Creating Files In Project Files Folder?

May 22, 2012

Ok I know this question has been asked to death but I still have not seen a good answer. I have created an application in VS2010 using VB.NET. In my application I have an error log that is an XML file located in the Public gstLocalErrorLogLocation As String = Application.StartupPath & "ErrorLog"that gets written to in the event of an error so I can trouble shoot application easier. My application also downloads files from our FTP site and puts the files in Public gstLocalDownloadLocation As String = Application.StartupPath & "download"So I have files that get read and written to as well and created and deleted all in the Application.StartupPath which is either "c:Program Files(Application Directory)(Some Directory)(Some File)" or "c:Program Files (x86)(Application Directory)(Some Directory)(Some File)" depending on 32bit or 64bit Windows 7.

After creating the setup I install it on my test machine that have both Windows 7 32bit and 64bit.Everything in the application works great till I have to write to, delete or creat a file in those directories above. I know it is an access issue and the UAC. This will get installed on numerous systems so the options I have seen to change file or folder permission on the computers manually is not an option.What has to happen is after I install the application it just works like when you install it on XP. Some post have suggested that you us a user with administrator privilages or group which is all fine and dandy but the user I have used to test the application has all of that.

So what I am asking is how do you create an application with VS2010 in VB.NET that after creating a setup package and installing on Windows 7 will just work with out "Access to the path c:Program Files(Application Directory)(Some Directory)(Some File) is denied." If I have to install this on 100 Windows 7 computers it has to be a concreate no manually doing anything just install and work like when we installed on XP.

View 5 Replies

Display Text In Slow Motion?

Jun 24, 2010

How to Display Text in slow Motion.

View 16 Replies

Application Slow Is DB Access/text File Code Ok?

Jan 26, 2012

I noticed that my application is running a bit slow. This is a Windows Service built using VB2010 with SQL Server as a back end. Its main function is to poll a folder looking for a text file. If found it reads the text file and imports the data into SQL Server.

While the slowness could be caused by a number of reasons, I am looking at my code to determine if it could be more efficient. Below I've pasted snippets of code where I initialize the DB connection and execute SQL statements. I've also included a snippet that illustrates how I am processing the text file.

I'd appreciate if the group could have a look at these and let me know if the method that I am using is the most efficient possible. At this time I am also focusing on other probable issues, but I can't rule out the possibility that the code that is in place might be a contributing factor.

[Code]...

View 4 Replies

VS 2010 Extracting Specific Text From A String Is Slow?

Feb 23, 2012

I have a text file I'm trying to pull specific data from to make a report in excel and am wanting to know if my code can be improved or if I have something wrong. If it's apparent to anyone that I should be doing something elThis code does work but, very slow. These reports take up to 20 minutes for about 100 files so I am wanting to decrease the time somehow. I have attached the whole sub in a text file, it's about 900 lines long so don't think I should post all of it. This is one part that seems to take the longest:Partial code that reads the text into a string, then each line is read to find whether it holds the data or not. Inside this while loop, I am checking numerous lines to see what they hold and extract specific items. First I verify it's a interface by checking for "line protocol".

Dim str As StreamReader = File.OpenText(filefound)
While (str.Peek <> -1)
If txtLine.Contains("line protocol") = True Then 'Found an interface,

[code].....

View 10 Replies

VS 2010 Print Photos And Text Very Slow Spooling

Feb 17, 2011

I'm making a program that will print jpeg's.The way i have it is I have lots of forms with buttons and when you click a button it prints the photo and a databound label with a line of text.The problem is that i want the user to be able to click one and then click another button right after, to print another one, but as soon as i click one, the program freezes until the photo starts printing so the user cant click to print another one right away.Each picture is around 4 mb.Is there away to make it go faster?The pictures i'm printing are from a pdf file with text and images in it that were converted to jpg. Each page is another jpg. Is it possible to print directly from the pdf and would it be faster since the words are 'text' and not a 'photo'?

View 5 Replies

Rich Text Box - Program That Will Read From Various Text Files (preferably RTF Files)

Apr 20, 2009

Im designing a program that will read from various text files (preferably RTF files) and then put them into the RTF box in the program when a button is clicked.

Here is the portion of my code that i am referring to.

Try
Dim fileText As String = My.Computer.FileSystem.ReadAllText("c:\" & selectedHero & ".rtf")

infoDisplay.AppendText(fileText)
infoDisplay.Rtf.Format()

Catch
MsgBox("Selected Hero currently has no File with us.")
End Try

Now heres the problem. In the file i have a few pictures and its formatted and what not. I thought since its a RTF file and the Box is RTF it would auto format.... but anyways. It appears like this in the RTF Box.

{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fcharset0 Arial;}}
{\*\generator Msftedit 5.41.15.1507;}\viewkind4\uc1\pard\f0\fs20{\object\objemb{\*\objclass Paint.Picture}\objw3000\objh3000{\*\objdata

[CODE]...

Ok so im not sure how i can read from a RTF file and put it in the RTF box with the right format....Ive been searching around for a while.

View 9 Replies

VB: Searching For Text Within All PDF Files And Returning Results Of PDF Files Where Text Are Found On

Jun 20, 2011

On a image file (PDF), the OCR has recognised the picture and text. However on Visual Basics, how do you search for a text on this image file? The primary goal is to allow a text search (i.e POxxxxx) on all the image files (PDFs). The returns of the search will be the assciated image files where the text (i.e POxxxxx) is found on.

View 1 Replies

Data Terminal Device Slow Searching String In Text File?

Apr 4, 2011

Is there a way to search fast in text file? i have a 5mb text file and it is slow to search ..Im using Vs2008 (VB) and MC3100 WinCE 6 platform

Code
Private Sub DataHandler()

[code].....

View 8 Replies

Creating PDF Files In VB?

Apr 23, 2009

Is there a way a tool or a plugin one can use in VB.NET to create pdf files.I woul like to use that for reports

View 1 Replies

Creating Compressed Files?

Mar 9, 2010

I want to add multiple files to a single compressed file using System.IO.Compression. And extract them back...So I found this code on MSDN which works fine, but does not support adding multiple files into 1 single compressed file. [URL]

View 1 Replies

Creating Images From Files?

Apr 8, 2010

Is there a way that I can create images (bitmap, tiffs, whatever) from txt,docx,pdf,or rtf files?

One idea that I found was creating a Metafile from the file. However I am get GDI+ errors with the palette. how to get around that? Do you think this is the right track?

Dim
gr As Graphics = Me.picFile.CreateGraphics() 'i am really not using a picture box, but I thought if it helps, why not?

[Code]....

View 11 Replies

Creating Log Files For Troubleshooting?

Apr 6, 2009

I am attempting to add code to an existing script that will add the log messages to the log txt file in order to determine which loops are running in the script. But all I get is either a blank log file or only one line which I believe is the last loop that ran and not a concatination of the loops that ran which I know is more than one.

How do I create a log file that will continualy grow?

These log calls are placed in each of my loops (I am just showing 2 as an example.)

log ("in loop 1")
log ("in loop 2")
etc

[Code].......

View 1 Replies

Error In Creating Files?

Jul 18, 2012

i am making a simple form which can create the text file from the database table , for this , i am using this code at the load event of my form so that it can create the files at the load time.

IO.File.Create("C:Customers.txt")
IO.File.Create("C:Towns.txt")
IO.File.Create("C:Products.txt")

this code is working fine , but when i try to write my data in these file then the error come which is "the process cannot access the file 'c:owns.txt' because it is used by another process" i dont know where this file is used by my computer?

View 5 Replies

Creating Log Files In Vista & Win7?

Jan 27, 2012

Ok I have a application that works great on XP, but in windows 7 it will not let me write to my login file, says access is denied since I am not running as admin. Log file is located in "C:Program FilesCompany NameProductMyLog.LOG"

View 1 Replies

Creating StreamWriter At RunTime For Different Files?

Mar 9, 2009

I want to create files based on the particular value of supplied recordset using the StreamWriter at RunTime. The files will be dynamic these will be create based on particular field.Example: If I have list of employees, I don't know from which city of the country they came from. I want to create a different files for every city and write those employees in to the corresponding files at runtime.

View 1 Replies

Creating, Packing And Unpacking .zip Files In .NET?

Aug 7, 2010

I am planning on sending some of my friends and colleagues a copy of a program that I made. For this program I was going to include a .zip file of some extras for them to look at. Is there a way in VB.NET to create a .zip folder, copy things from the program's resources into the .zip folder, and then later on be able to unpack them? PS - The purpose of this is to copy items from the resources into the .zip folder so that I can send everything in one program.

View 10 Replies

Database - Creating And Managing *.db Files

May 26, 2012

I have seen a few .NET apps use .db files. I am not new to Visual Basic, however I have never created a VB app that uses databases. I do know PHP pretty well, and working with databases in PHP I am familiar with.

[Code]...

View 1 Replies

VS 2008 - Creating New Schema (XSD) Files

Jan 22, 2010

I recently started having problems when creating new schema (xsd) files inside Visual Studio 2008. When I create a new schema file, the only file that is created is the xsd file itself. Neither the designer.vb or xsc files are created, which of course makes it unusable. The problem seems to be caused by the fact that the CustomTool property in the property grid is missing. If I change the CustomTool property to MSDataSetGenerator, then it immediately runs and creates the missing files noted above. How do I reassociate the CustomTool with Schema files?

View 2 Replies

VS 2008 What's The Best Software For Creating Files

Dec 18, 2009

what's the best free software for creatingfiles. I'm using vb.net 2008 express.

View 5 Replies

Pure Text Files / Handle Special (german) Characters In .net Vs VB6 Old Files?

Jul 17, 2009

i have an old VB6 system that generates plain text files. When this old system writes "A" into the file, it writes (hex) "41". For an "ä" (a-umlaut, special gernam character), it writes (hex) "E4".

Now i have to process files like this in VB.Net. when i open such a file in the IDE, it displays correctly "ä" (But not always!). To see what i mean, please open a notepad and create a new file "ae.txt" with content: äöü. Now your file contains exactly 3 bytes: (hex) E4 F6 FC.

But when i write code like
Dim strTest As String
strTest = File.ReadAllText("ae.txt")
Debug.Print(InStr(strTest, "ä"))

i get 0 - so i cannot find back the "ä" - what do i need to do, to find it? And 2) for compatibility reasons, i have also to be able to create such files. How to do that? Seems the different encoding types do not work as i think.

View 2 Replies







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