VS 2008 Newly Created File Has Older Date??

Apr 9, 2009

I have encountered a wierd problem, and I'm unsure if this behaviour is caused by my code or by Windows itself... I can't make any sense of it! Basically, I have written an automated backup system for a text editor. It should save up to 5 backups for each filename, each in a 'AutoBackup<filename><filename>_<number>.bak' format. Here, <filename> is simply the name of the file my program is backing up, and <number> is the first 'free' number. So if the backups are "Test_1, Test_2, Test_4, Test_5", the next backup will be called "Test_3" (since 3 was 'missing'). When there are more than 5 backups, I want my code to delete the oldest files until there are again 5 backups left. I am using the following code for this:

vb.net
'Backup doc.SaveFile(path & "" & filename & "_" & newNum & ".bak") 'If more than max files, delete oldest Do While numOfFiles > maxBackups Dim d As Date Dim maxDate As Date = Date.MaxValue Dim oldestFile As String =

[code].....

Then, after another backup, Test_1.bak is again deleted!I thought this was pretty weird so I had a look at the files in windows explorer, taking a good notice of the creation date... That's when I saw that after Test_1.bak is created a second time (after a file named Test_1.bak was deleted), it carries the same creation date/time as the old (deleted) Test_1.bak..So my code still sees it as the oldest file (while it is actually the newest) and deletes it...

View 7 Replies


ADVERTISEMENT

Save Gif File With Newly Created Tag?

Feb 15, 2010

I have been working on this for a while and this is what I got so far.[code]...

View 4 Replies

Make Program Not To Use The Newly Created File 'text.txt'?

Aug 5, 2011

I have this program:

Module Module1
Sub Main()
IO.File.Create("C: ext.txt")

[Code]....

How to make my program not to use the newly created file 'text.txt'? Notepad fails to open it, it says (The process cannot access the file because it is being used by another process).

View 1 Replies

Cannot Open Newly Created File - Inconsistent Line Ending

Jan 20, 2010

I wrote a program that writes to a new created file a line of text. Anytime I try to open the new created file, I see a dialog box titled "Inconsistent Line Ending". I do understand why I receive this message. I wrote this program in VB.NET.

View 1 Replies

Move Files In The Newly Created Folder In The Temporary File

Oct 27, 2009

creating a new folder on a temporary file and moving/copying a file on the newly created temporary file.

View 4 Replies

"The Process Cannot Access The File" When Dealing With A Newly-created File?

Jan 10, 2012

I'm using the VB code below to create a file and write to it:

Dim myFileStream As New IO.FileStream(tempFolderLocationLabel.Text & "" & tempFileName, IO.FileMode.Create)

Dim myStreamWriter As New IO.StreamWriter(tempFolderLocationLabel.Text & "" & tempFileName)

myStreamWriter.Write(sageLinkerRef)

myStreamWriter.Close()

myFileStream.Close()

View 1 Replies

VS 2008 Add A Newly Created Textbox To A Dynamic Textbox Array

Aug 30, 2011

I wanted to simply on click a button to add those newly created textboxes to an array of textboxes. Starting with those labeled "Address". But I am finding this very difficult. I am able to add those originally on the form into the array very easily. But am unable to add the newly created textboxes into the array.

Here is my code so far below.

Public Class Form1
Dim MyBoxes() As TextBox = {Address, UserName, Password}
Dim Numbox As Integer = 1

[Code]....

View 2 Replies

Add Command To Newly Created Control?

Apr 26, 2009

this is what i have so far:

[Code]...

View 6 Replies

How To Get Newly Created Node's ID From Server

Sep 13, 2010

I currently have a JSTree all set up to do the creation and renaming of a new node:[code]The problem is that my success doesn't seem to get hit when I return an integer ID on the create node, thus I can't set it to a global variable. What exactly do I need to return in the function to get back the ID from the server? I'm simply returning a new integer right now.

View 1 Replies

How To Monitor Newly Created Files

Jul 26, 2009

I know how to monitor newly created files etc but what i want to do now is monitor firefox and IE when they close. my application is running in the bg and i need it to perform a command when the browser closes.

View 4 Replies

Adding Events To Newly Created Controls?

Mar 5, 2010

Im curently writing an app for windows mobile (so its using the compact .net framework)It has a loop which finds out how many images are in a folder, makes a picturebox for each one, then sets the .image property to the appropriate image. It also adds the name, size, location etc.What I dont know how to do is add a mouseclick event to it?I probably would have a subroutine already written in the code which could be used, or would it have to be a new one made for each picturebox?

View 1 Replies

Can't Save An Image To A Newly Created Folder

May 24, 2012

I am getting this error trying to save an Image to a newly created Folder.

View 8 Replies

Updating A Dataset With Newly Created Tables On The Fly?

May 4, 2010

I have made a form that creates a table in a database based off of the text a user inputs into a text box.I would like to then display that table in a DataGridView on the form so that the user can update the data in that table.Is there any way that i can add those tables to the dataset and get them to display in the DataGridView after the user clicks the create table button?

View 7 Replies

VS 2010 Open Link In Newly Created Tab

Apr 17, 2011

im having a problem now when opening a link in newly created tab.. i have a tabcontrol and only 1 tab for the main.. the main tab have only 1 textbox and a button the user put a URL in a textbox and after the button is click it creates a new tab and navigate to that url.. i can create a new tab after the button is click but my problem is after the button is click it not focus the newly created tab..

View 2 Replies

TabControl Not Selecting Or Adding Item To Newly Created Tab?

Jan 18, 2011

I have a Private Sub that I execute whenever a user clicks one of two or three things, and in it I create a new tab in my TabControl. Once the new tab has been created, I select it then add a formatted textbox to it. However, it is not selecting the new tab and therefore only adding the rich text box into the already selected tab (not displayed, of course, because it has a dock style of Fill.) Here iis my code to select the new tab and format / edit the rich text box:

Try
tabMain.SelectedTab = tabMain.TabPages.Item(intTabIndex) 'Select the new tab
AddHandler rtbCode.TextChanged, AddressOf DisplayUpdate 'Add TextChanged event to handle updates

[Code]....

View 4 Replies

Display The Date A Text File Was Created?

Jan 11, 2011

I want to display the date a text file was created and modified could anyone point me in the right direction? Visual studio 2008

View 9 Replies

Get Date Time Created Of A File In Gridview?

Aug 10, 2011

I have a gridview that looks something like this[code]...

How can I display the file's date time created in the gridView (by that I mean what is the correct syntax for)[code]...

View 3 Replies

Add A Newly Created Textbox To A Dynamic Textbox Array?

Aug 30, 2011

I wanted to simply on click a button to add those newly created textboxes to an array of textboxes. Starting with those labeled "Address". But I am finding this very difficult. I am able to add those originally on the form into the array very easily. But am unable to add the newly created textboxes into the array.[code]....

View 2 Replies

Add A Newly Created Textbox To Dynamic Textbox Array?

Aug 30, 2011

I wanted to simply on click a button to add those newly created textboxes to an array of textboxes. Starting with those labeled "Address". But I am finding this very difficult. I am able to add those originally on the form into the array very easily. But am unable to add the newly created textboxes into the array.[code]...

View 2 Replies

Software Created In An Older Framework Version Won't Run On A Newer Framework Version?

Apr 7, 2009

How come software created in an older framework version won't run on a newer framework version? Actually whenever i try to run some old specific software having .net 3.5 framework on my PC they show they needs .net framwork 1.1 . What a bad thing?My newer version of Photoshop ans Ms office open all lower version files.

View 6 Replies

VS 02/03 Older Version Of Commands - Reading A Text File To A String ?

May 19, 2009

Tell me older versions of these commands to be used with .NET 1.1?

The pieces of code I am using are:

For reading a text file to a string-

Dim str As String
'reading the content of the file "test.txt" and storing it in the declared variable

[CODE]...

View 4 Replies

VS 2008 - Compiling Program Got Stuck On Older Version

May 29, 2009

I'm using microsoft visual studio for VB.NET 2008. When i compiling my program it's got stuck on older version of the program, i even change some of the label text in the design mode and it still loading the old label text, is any one ever had this problem before?

View 3 Replies

VS 2008 Identity Of Newly Added Record - Access Db?

Mar 13, 2010

I've read about @@Identity. I've also read that it's no longer supported. I get lost in the mountains of data searching provides.I'd like to get the "ID" field, which is an AutoNumber Primary Key field, when I insert a new record. There's got to be a simple way.

View 1 Replies

VS 2008 Created An Xml Schema And An Xml File From Datatable

Jul 9, 2009

I have created an xml schema and an xml file from a datatable. I am now trying to read that data in which is working fine. I can access the data but the problem is that I want to know how many Tables there are in the xml file. For example the setup looks like this: [code] I want to know how many "<table>" objects there are.

View 2 Replies

Get The Folder Name To Update With The Date And Be Created Automatically?

Sep 28, 2008

how do I automate creating a folder.I want the folder name to update with the date and be created automatically.

View 2 Replies

VS 2010 Sorting Files By Time Created By Date?

Mar 11, 2011

I have a Datetimepicker, when i select a date it brings up in a listbox all the files created on that day but in no particular order. So i wanted it sorted by when they were created (not to fussed either ascending or descending). i tried using the code below with no luck, This adds multiple of blocks of the same files on the selected date

[Code].....

View 2 Replies

VS 2008 Saving A File Put Cur Date At End Of File Name?

Jun 9, 2011

Here is my current file

Public
Class Form1
Dim ScreenData(3, 4) As TextBox
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
FileOpen(1, CurDir() &

[Code]...

View 2 Replies

VS 2008 : Get The Date Of A File On The Web?

Jan 26, 2010

I have an application that runs, scans a webpage for links to PDF files, and downloads those files (using WebResponse). I want to modify it so that it ONLY downloads the file IF it has been changed since my program ran last. So, given that I have the file name:

[URL]

How can I determine the creation and last modified date of that file? Preferably WITHOUT downloading the file, of course.

View 3 Replies

File I/O And Registry :: Write Out A Date Like This 09-16-2008?

Sep 17, 2008

I'm trying to write out a date like this 09-16-2008 so I can put the date in the name of a directory. Here is my code:

Code:
Dim aDate As Date
aDate = Date.Today
aDate.ToString("MM dd yyyy")

[Code].....

I can't seem to get the leading 0 in front of the month if it's a single digit. I can't get rid of the time, and I can't get the dashes.

View 2 Replies

VS 2008 Check Date Of File On Website From Win Form App?

Jun 4, 2011

From within my VB 2008 windows forms app, how would I check the date (i.e. modify date) of a file on a website (i.e. "www.mysite.com/somefile.txt")?

View 1 Replies







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