Writing 3 Times To A File

Jan 26, 2011

I am using VB.net and am puzzling over an issue which cropped up.I have writen a POS application and am writing a number to a .csv file after each transaction.The problem I am having is this number is written to the file 3 times for each transaction.[code]

View 6 Replies


ADVERTISEMENT

VS 2008 File Handling - Create A '.txt' File And Then Fill In The Dates And Times When The Program Is Opened

Oct 25, 2009

I want my program to be able to create a '.txt' file when it is run for the first time, with the date and time the program was accessed, and to be able to add new 'logs' of program history every time it is accessed. What i mean is that i want my program to be able to create a '.txt' file, and then fill in the dates and times when the program is opened.

View 7 Replies

Enlarge An Image Up To 32 Times Or 64 Times Bigger Than Original?

Dec 12, 2011

I want to enlarge an image, possibly up to 32 times or 64 times bigger than original dimensions (so that the user can see each pixel) if possible. The following is a simple function that I have to enlarge an image.

Private Function xEnlarge(ByVal Source As Image, ByVal Rate As Double, Optional ByVal Quality As Drawing2D.InterpolationMode = Drawing2D.InterpolationMode.HighQualityBicubic) As Image

[Code].....

View 6 Replies

Avoid FileSystemWatcher From Showing Same File 3 Times?

May 4, 2010

I have a FileSystemWatcher and whenever a file is changed/created it is uploading the file for me to an FTP. My problem is that it keeps uploading the same file 3 times.

View 5 Replies

File Creation/modified Date/times?

Mar 16, 2010

I created a background thread that constantly scans a specified folder for any .xls files that are created or modified. These files come from a vba macro in outlook that will automatically save the attachments of the mails in the this folder. This will update the modified date/time, or at least it seems to.

For Each fi In aryFi
fidate = System.IO.File.GetLastWriteTime(path & fi.ToString)
fidate1 = System.IO.File.GetCreationTime(path & fi.ToString)

[code]....

Everytime I check to the code, the fidate and fidate1 variables are indeed the correct dates/times of the file it's currently checking. It almost never gets inside the elseif block at runtime though.

View 1 Replies

Setting Times And Dates For File Names

Feb 16, 2012

Im using VB to set default dates and times for the file names when a form is saved through InfoPath, this is what I have so far:

[code...]

This works but i need to format it to this:

ddmmyyy and hhmmss

I need zero's before single characters as if its only a single character then it only displays 1 eg if its 9 in the morning it'll display 9 rather than 09 and i need 09.

View 4 Replies

Forms :: Find If Times Is Between 2 Times?

May 13, 2009

I have just started using vb.net and I have a checked list box with times throughout the day shown as

00:00 - 00:14
00:15 - 00:29
00:30 - 00:44
00:45 - 00:59

What I am trying to find is a way to get the current time and find which list item it fits into. What I think I need to do is to first of all get the current time and then go through the list splitting each item into 2 times and seeing if the current time fits. For example: Split the item 00:00 - 00:14 to 00:00 and 00:14 and then check if the current time is more than 00:00:00 but less than 00:14:59 and if so do certain task.how to go about taking each list item and splitting it into 2 separate times so I can check between them?

View 2 Replies

Add A Line To A Text File Only Once But Add Other Information Multiple Times

Apr 6, 2011

I need to add this line to a text file that is going to have other information added to it several times. I also need to add this line and have the number change every time the additional data is added.

View 6 Replies

File.Copy Many Times Results In System Crash

Jul 18, 2008

.NET masters!Im working on a VB.net file management program that copies 100,000s of small images (20 - 300 KB).At least it tries to. When doing large multi-hour operations I start getting exceptions with the"Insufficient system resources exist to complete the requested service." error message.In a few cases the computer has then crashed.After a lot of debugging, finally with livekd kernal dump I can see that the System PTEs in the Kernel Mem are getting very low.I can monitor the PTE's in realtime with Performance Monitor with the Memory/Free System Page Table Entries.After an hour or so the PTE's start dropping in what appears to be linear fashion as the program keeps copying.Im sure it is the copy function causing the problem, as when i let the code run but with the copy routine commented out, the free PTEs stopped going down.Behaviour is identical with both of these calls. System. IO. File.Copy(strFileSource, strFileDest, bOverwriteFile) My.Computer. FileSystem. CopyFile (strFileSource, strFileDest, bOverwriteFile)If I stop & close the program, PTEs do not seem to rebound at all. If I start the program again, the PTEs again start going down.SO: What is up with File.Copy? Why is it using and not releasing all these PTE's? Seems this memory should be free after the copy.How can I change my code to avoid running up the PTEs?The test computer is Windows XP sp2 with 500MB ram. (also been testing with 1.5 G ram)Ive found some helpful documents on PTEs, which discuss system configuration via registry settings. But this is not really an option for me as this is a commercial product that others will be using on their own computers.Detection, Analysis, and Corrective Actions for Low Page Table [code]

View 7 Replies

One Button Click To Execute External File 2 Times?

May 12, 2012

having dramas with closing mysql portable with the command

HTML

CALL binmysqlinmysqladmin.exe -uroot -p123 shutdown I need to execute the batch file twice for the mysql to shut down in the full blown version it works great.

so whatg i was thinking is using button to execute the batch file 2 times from one click.

View 1 Replies

File I/O And Registry :: Reading/Writing Objects To File?

Jul 5, 2009

So I need to write out an object to a text file as well as read in objects from text files.How do I accomplish this? This is the code i've used to read and write just simple lines of text. Is there a small modification to this or just a different function i use to read in an entire object?

Code:
Dim path As String
path = "Security.txt"

[code].....

View 4 Replies

File I/O And Registry :: Text File Reading And Writing?

Jul 17, 2010

I have just recently been using VB 2010 after using VB5. I have noticed a lot of changes. The problem I have is that I wish to open and save text files to and from arrays in the background. I've attached what I would do in VB5. I have searched around, but all the examples I find use a Textbox instead of an array. Can anyone show me how I can do this with VB 2010?

View 1 Replies

Save File Dialog And Writing In Text File?

Jun 9, 2011

I am creating a text file using a save file dialog and copying the path to the text box which file is used to write from vb.net. when i try to write i get an error "The process cannot access the file '....fileName.txt' because it is being used by other program".

The code is below

Public Sub writeInTextFile()
Try
Dim oWrite As New StreamWriter(TxtOutputPath.Text)

[Code].....

View 4 Replies

Writing Array Of File Names To Text File

Mar 11, 2010

I am attempting to gather a group of file names from a directory. I am able to do this. I tested the code by having the list populate into a listbox and all desired items were added to the list.

Here is my code:
Dim di As New IO.DirectoryInfo(strPath)
Dim dir1 As IO.FileInfo() = di.GetFiles("*.txt")
Dim dFiles As IO.FileInfo
ListBox.Items.Add(dFiles)

However, a listbox is not my desired output. I am attempting to write these file names to a text file for purposes of then parsing the information to a datatable to compare with another datatable. How to get my filenames written to a textfile.

View 2 Replies

Writing File/Folder Sync Prog, Result Text Boxes Not Updating Untill After All File Action Is Done Even Though Update Code Comes Before Copy?

Apr 12, 2011

I am working on a program using VB.Net 2010 which will enable me to setup groups of files & folders for back up with syncing capabilities etc. I have a concept program which is based on some sample code I found out in one of the VB.Net forums. I have modified it from a command line based program to a form based program. At the moment I consider this code to be a "concept" program which once I have the various copy/sync routines developed and debugged will be integrated in to another program I wrote for
creating "Back Up" groups to automate the process. There are some 3rd party programs that do similar things that I want to do such as Microsofts Sync Toy, but none of them offer the grouping and exclusions options that I am going to program in to this backup/sync program.

So here is my problem, I have the included code taking two folders, a source and a destination, and copying everything from the source to the destination. It will skip over any unchanged files/folders and will delete anything found in the destination folder that is not found in the source folder and it will update all files in the destination folder that have a newer version in the source folder. In other words it will mirror image the source to the destination but will be smart enough not to copy unchanged items from the source to the destination thereby saving a lot of time. The sync part of the program is working fine, the displaying of the progress and results is not.

[Code]...

View 2 Replies

File I/O And Registry :: Writing An Array To A File?

Jul 6, 2010

I have a structure in memory which is working fine - now I need to write this entire structure to a file.The below code almost compiles, the problem is that "mstaRecordInfo" cannot be changed to a string, probably because of the Date field. I've just spent over an hour experimenting and searching the web but have gotten no closer to a solution

[Code]...

View 3 Replies

File I/O And Registry :: Writing Array To A File?

May 31, 2011

I am trying to print the contents of my array to a text file, but instead of just printing whats in the array it prints all indexes even if they are empty.

this is the code i am using..

Code:
FileOpen(3, "garbage.txt", OpenMode.Append)
Dim intCounter As Int16
For intCounter = strFirstName.GetLowerBound(0) To strFirstName.GetUpperBound(0)

[Code].....

View 2 Replies

File I/O And Registry :: Writing Data To File?

Jun 6, 2011

for a school project I have to write data from a listbox to a new file that a user can create. I can create and save a file no problem, but for some reason I can't write anything. I followed the textbook provided but when the file saves, I open it up and it is blank. I'm using fileWriter.WriteLine and I'm just test something basic to write to a file first and I can't do it:

Code:
Private Sub storeFileButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles storeFileButton.Click
'creates a new file
Dim result As DialogResult ' stores the file
Dim fileName As String ' name the file to save the data

[code]....

View 2 Replies

VS 2008 Writing To Same File Twice Causes File To Be Cleared

Jul 11, 2009

Well I'm in the middle of making a program to edit .ini files. Although I have hit a snag. I can save my settings (relies off checkboxes) with ease, however if I change something and/or hit the save button again even after the code has finished, both my entire .ini files are cleared (filePath and filePathPrefs) and all text is gone. Here's my

[Code]...

why it's clearing the .ini file even after the initial write worked? I've tested to make sure the entire code has finished before making another save with different settings but the issue happens again.

View 5 Replies

Writing To TXT File?

Jul 15, 2009

Okay im trying to write a TXT file, but also keep the contents already in the file.

For example
Before Program Run:
Sample123.txt reads:

[code].....

View 6 Replies

.net - Formatting Csv File Before Writing?

May 4, 2011

i want to write data in csv file using vb.net. so before writing the data i want to format the cell to text.how to do this.

View 2 Replies

.net - Writing Hexadecimals To An Exe File?

Nov 9, 2011

how to write these hexadecimals to an exe file while still having it exec

4D 5A 50 00 02 00 00 00 04 00 0F 00 FF FF 00 00 B8 00 00 00 00 00 00
00 40 00 1A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 BA 10 00 0E 1F

[code]....

View 3 Replies

.net - Writing Xml File To Web Service?

May 22, 2012

I am able to read the xml file into dataset. Currently it is printing in a string format. Is it possible to print in xml format from web method call. I want to publish through dataset.writexml

[Code]...

View 2 Replies

Creating And Then Writing To A File?

Jun 23, 2011

Im having trouble creating and then writing to a file. First, I check to see if the file exists, if it does not, then I create the file, close it, and then open again for appending text. I am getting an error during debugging saying the file is in use by another process, which is confusing since I am closing the file before opening it to append any further text. Here is my code:

[Code]...

View 3 Replies

File Writing Or Database?

May 18, 2009

I'm makin an application which will calculate the amount of carpet needed to floor a room, i would like to add in an order management bit too the application so that the user can add, delete and amend pending jobs. I'm a bit of a beginner so i don't know which way is really best to go, should i use file writing on database? I will be takin values from variables and textbox's if thats of any importance.

View 13 Replies

Getting File Writing Error

Aug 16, 2009

I try to write some data in a ini file. i can do that first time but second i give me an error[code]...

View 12 Replies

Over Writing An Existing File?

Aug 14, 2011

Over writing an existing file.

View 6 Replies

Reading And Writing To A Txt File

Jun 27, 2011

I have a tab spaced txt file that looks somthing like this;

[Code]...

I'd like to be able to read in the file and have a pop up message ask somthing like this; "Is cash1 for comp1 correct?" If yes ask about the 2nd line and if not ask what the real cash total is and then over write that to the file, then ask about the 2nd line.

View 2 Replies

Reading And Writing To Csv File?

Dec 31, 2010

i am working on a Yahtzee projeect for college and am struggling with reading and writing to a csv file the code i have to read the file works but only gets the first column and displays it on a line not as a list.

Private Sub HighScoreFrm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

[Code]....

the other criteria i have to work towards and wondering if anyone can help is to limit the amount of records to 10 so need to check what the lowest score is and if the current score is higher over write it,

View 5 Replies

Writing An Xml File Using A Module

Feb 18, 2010

I am creating an application thats output is xml files that all have the same route node and then 4 child nodes and in each child node there are different numbers of grandchild nodes in these child nodes. At the moment i am trying to write the xml file starting from one form that has 5 different calls to the module to write the root node and then the 4 children.

but this is as far as i get. because each routine replaces the total xml file so i am left with the 4th child node. I would like to be able to create an XML writer that i can feed from the outside the names off the elements and attributes and values. Here is the code i have at the moment:

[Code]....

View 5 Replies







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