Change File Creation Date?

Apr 29, 2009

I'm trying to save a files save date, modify that file and then restore the file back to it's original date. I can't get it to work, I've tried it several ways and cannot get it to work.

My code so far is

origdate = My.Computer.FileSystem.GetFileInfo("inspection").L astWriteTime.ToShortDateString()
' changing file content here
System.IO.File.SetLastAccessTime("inspection", origdate)

View 2 Replies


ADVERTISEMENT

Asp.net - Know The File Creation Date

Sep 27, 2011

I have a files list which contain the directory of file. I want to know file creation date of that files. I used fileInof.CreationTime. But It is not displayed creation date. How I can know about this.

[Code]...

View 1 Replies

Compare Date Of File Creation

Aug 4, 2010

be able to check if an application i am writing has been run on a week by week basis. i have created a button that when pressed creates a text file with nothing in it, i can read back the date it was created which also gives me the time which i dont need, i then need to compare the date the file was created to see if it is older than 6 days if so delete the file. how can i check to see if a creation date is older than six days???

View 9 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

File I/O And Registry :: FileStream File Creation With Date?

Apr 16, 2009

I have found many pages referring to having the date be part of a txt file being created, but not like the way I need. Having said that, this is what I've got.. [code] I read a page on working with txt files and learned what I could from it. It said to use the method in the beginning of my code for creating the file. It works great, but I would like to have a new file name everday, hence the date being integrated. So even if program was running, when midnight hits, a new txt file is created and new entries are written to that file. But I can't even get the date to be put in there. Everytime I try to make this work by using methods I read about in other pages, I get a syntax error, or a warning saying an end of statement is expected. I'm not sure those methods are compatible with what I've already got going.I was actually trying to store these values in a database, and I got real close I think, but I couldn't get any help to fix my problem so I'm trying to write to daily txt files instead. url....

View 6 Replies

Creation Date Column In SQL Table?

Apr 29, 2010

What is the easiest way to automatically fill a datetime column in an SQL data table with the date the row was created? Using SQL Server 2005 if that matters.

EDIT: I've tried using GETDATE() for default and that works for an INSERT Query but not when the TableAdapter adds the row.

View 6 Replies

Get Creation Date Of Multiple Files In Vb?

Jul 20, 2011

I'm trying to pull the creation date of all the files (1000+) in a folder on a local server to list in an excel file. I've been trying to use FileSystemInfo for this, but it doesn't seem to work to get the creation date of MULTIPLE files because it doesn't allow me to use wildcard characters to read all (not even sure if that's what I'll need to do).

View 1 Replies

Check Creation Date Of Executable That Is Currently Running

Jun 9, 2009

I would like to implement into my program a version query of the executable and I figured the easiest way would be having a check on the date of the executable. So how can I check the creation date of the executable that is currently running (from the program itself that is)?In short - double click on .exe and it will tell the date of its creation

View 10 Replies

Loading Text Files Into Oracle Using Creation Date?

Apr 12, 2011

I've written a loading program that writes text files to our database. The text files are dumped by another system every 2 hours onto on a shared network drive at my work. Here's the problem though - the files don't have a date/time stamp within them. I've been getting the date for each file from the creation date. That works okay, but when I've written loading programs in the past, I like to move the loaded files into a folder called "Loaded Files". That way, I can quickly see visually how many files I've loaded vs how many have not be loaded.

The problem this time, is that if I were to move the file into another folder, the creation date changes...a lesson I learned when I copied all of the files into a directory on my C: for testing. They all had the same date/time stamp!My question is, what's the best way to handle this? I don't want to move the files after loading them if it alters their creation date. I mean, what if I have to go back and load one for some reason, the date will be lost forever. I also don't want to write something into the software that has to check a file each time before loading it to the database.

View 2 Replies

Creation Of Program To Create Security Code Based On Current Date?

Apr 3, 2012

I need some help in the creation of a program to generate a security code based on the current date. I need to create something that first multiplies the MMDDYY (ie X=MM * DD * YY) then also adds the MMDDYY then finds the remainder and then multiplies but a specified number. I would like to create a small program that sits in the system tray with this code displayed. The code will always need to be 6 characters, so I might need to pad it with zeros. It has been years since I took basic VB, and I am really rusty.

View 1 Replies

Auto-change Date Of DateTimePicker2 On Entering Date In DatetimePicker1

May 31, 2011

I have two DatetimePickers on form1.

DatetimePicker2 is not enable.I want to auto change date of DatetimePicker2 on selecting a day in DateTimePicker1 by 3 days.

Example if i select MAY ,1,2011. in DateTimePicker1 then DateTimePicker2 must show Date as MAY,4,2011.

View 2 Replies

Change Date In Calendar Column To Reflect Date In Combo Box?

Apr 4, 2012

I have a calendar column which is generated on from load. Its value is assigned to todays date - for instance 04/04/2012

I also have a comboBox with a list of months.

Is there a way I can change the value of my calendar column to reflect the chosen month?

For example, if I select January from my comboBox then have the date as 01/01/2012.[code]...

View 5 Replies

Change The Forecolor If The Listview Date In The First Column Is Less Than Label 3's Date

Mar 16, 2009

It is supposed to change the forecolor if the listview date in the first column is less than label 3's date.

For ii = 0 To Me.ListView1.Items.Count - 1
Dim iInvoiceDate As ListViewItem = Me.ListView1.Items(ii)
If iInvoiceDate.ToString < Me.Label3.Text Then

[Code]....

No errors and all the variables are returning what i am expecting but it doesn't change the forecolor.

View 4 Replies

C# - Xml File Creation And Export It Using Asp.net?

Apr 19, 2011

how can i write <p> <br/> hello this is my creation </p> in xml file while i am creating it by the use of asp.net .

it is showing &lt;P&gt; text &lt;/P&gt;

View 3 Replies

Creation Of Classlibrary File

Mar 6, 2010

i wants to create an dll (classlibrary) file for displaying selected data form database by using a gridview control.for this iam creating an dll file , in that how to declare gridview1 [code]

View 1 Replies

Formatting Excel - If I Try Using Style.numberformat With The Date And Time Formats, They Don't Change And Are Entered As If Didn't Change The Format?

Mar 11, 2011

I am throwing some data out into Excel and am having some formatting troubles. I have 5 columns (date, time, a long number I don't want displayed in scientific notation - text is fine, text, text). I can get it all working with numberformat, however I have to do them different ways.

Date works this way cell.numberformat = "m/d/yy" and it formats it to say 3/1/11

Time works this way cell.numberformat = "h:mm AM/PM" and it formats it to say 8:07 AM

For the long number cell.numberformat = "@" and it doesn't change the format and it gets displayed in scientific notation

BUT if I use cell.style.numberformat = "@" it works as it should, but it messes up all of the date and time cells. Apparently when you use style.numberformat, it doesn't just apply to the cell you're working with. If I try using style.numberformat with the date and time formats, they don't change and are entered as if I didn't change the format at all.

View 1 Replies

Automatic Log File Creation/append?

May 17, 2010

I'm trying to make my application append to a simple log file when it executed and when it's closed. So far, so good (see code)

However, what I would like to do, is have future lines of text to be written on the next line instead of the same line. And possibly a date stamp.

I'm not quite sure how to implement this as far as syntax goes.

My.Computer.FileSystem.WriteAllText("C:log.txt", "Application was closed ", True)

View 3 Replies

Characters Not Allowed In File Creation?

Apr 15, 2010

How can I check for characters not allowed for file creation programmatically? you know like the / <> and so.

View 3 Replies

SDF File Creation For Window Mobile 6.5?

Apr 28, 2011

I create a vs 2005 project and a sdf file using ms sql server express 2005. And I try to connect it in MC65. I got this error The database file has been created by an earlier version of SQL Server Compact. Please upgrade using SqlCeEngine.Upgrade() method.

View 2 Replies

Thumbnail Creation From Image File

Aug 20, 2009

Im looking to create a thumbnail from a jpg image. the image is stored in c: empimage.jpg all im trying to do is create a thumbnail from this and save it in c: emp humbimage.jpg. Ive found a number of C# tutorials and some vb.net ones. Apparently this is a really easy thing to do.

View 1 Replies

After Closing Excel File, Error Comes Up During Creation Of Next One

Sep 30, 2011

I am writing my data to an Excel file. I have two functions, create excel file and close excel file. When I am creating the first excel file, everything works fine, but creating another one after the first has been closen, I am getting an "NullReferenceException" exception.

Dim xl As New Excel.Application
Dim wkb As Excel.Workbook
Dim wks As Excel.Worksheet

[Code]....

View 3 Replies

C# - Monitoring A Folder For New File Creation Without Using FileSystemWatcher In .net?

Aug 31, 2010

I have to create a windows service which Monitors a specified folder for new files and does someprocessing on it and moves it to other location. I started with using FileSystem Watcher. But my boss doesn't like FileSystemWatcher and wants me to use polling on Timer or any other mechanism other than File System Watcher.

View 8 Replies

VS 2008 - Read Only File Creation Time

Jun 22, 2011

I have a ERP system which create a PDF file and write it to the disk when the invoice is beeing created. On the other side a have an .NET app, which every 10 minutes read data in that folder and automatically send an e-mail to my customer with the invoice attached.The problem is that sometimes, when .NET app try to read a file which currently is beeing created -> The file is damaged. How to avoid such a situation? Is there a way to e.g. read only file creation time, and if it's "younger" than 5 seconds order app to wait a while?

View 5 Replies

Working In Visual Studio 2008, VB File IO Creation/Opening

Apr 26, 2011

I'm trying to search for a file in VB. If it exists I'd like to read it in. If it doesn't not exist I'd like to create it. I'm working in Visual Studio 2008. I was using a Streamreader before, but when I did that I was never getting any sort of error if the file wasn't there, which isn't what I want.

View 2 Replies

File Not Found After Creation Vista To Windows 2008 Server?

Aug 31, 2009

Using VB6 to create a file and then open the file just created fails when run on a Vista client with Windows 2008 Server. The same code will work when run directly on the Windows 2008 Server or when using an XP client. If a Sleep 10000 is placed after the close, the program will work. What is the problem here? The code is as follows:

Option Explicit
Private Declare Function GetTempFileName Lib "kernel32" Alias "GetTempFileNameA" _
(ByVal lpszPath As String, ByVal lpPrefixString As String, ByVal wUnique As Long, _

[code].....

View 1 Replies

Unable To Use Values Extracted From Database As Variables In File Creation

May 22, 2009

I have written a web page which connects to a database and then display 3 values from a management reporting system using the database.

I am accessing a database using the following code:

<asp:SqlDataSource ID="SqlToVersion" runat="server"
ConnectionString="<%$ ConnectionStrings:WebImportOnServer %>"
SelectCommand="SELECT [VerNo], [PeriodName], [PeriodNo] FROM [atblVersion]"

[Code].....

but it is how to replace the question marks with valid code that takes the values from the bound fields that I am stuck with.

View 3 Replies

Compare The Modify Date Of A File Vs The Current System Date?

Oct 22, 2008

I'm trying to compare the modify date of a file vs the current system date. I've found an MSDN article describing how to get the modify time of a file:

Dim infoReader As System.IO.FileInfo
infoReader = My.Computer.FileSystem.GetFileInfo("C: estfile.txt")
MsgBox("File was last modified on " & infoReader.LastWriteTime)

This gest the Date and Time, but I want just the Date not the time.

View 6 Replies

Can't Change Date Value To The Format

Sep 17, 2009

i cant change date value to the format which i want.This is my code.When i execute this code,i see mydate as mm/DD/yyyy format.what do i miss?

Dim dateString As String = Date.Now.ToString("dd.MM.yyyy")
Dim myDate As Date = Date.ParseExact(dateString, "dd.MM.yyyy", Nothing)

View 1 Replies

Change Date Format?

Apr 9, 2009

I have date in format dd/mm/yyyy. I have to change to mm/dd/yyyy in code behind of vb.

View 2 Replies

Change Date From Dd/mm/yy To Null?

Sep 15, 2011

i have a datetimepicker with showcheckbox properties set to true..

when there is date in database, the checkbox is checked..

but when the database is null, the checkbox is unchecked..

here's the code:

Sub checkeddate() 'to set DateTimePicker.check (compare from database)
'if db is not null, then CheckBox is checked
If IsDBNull(DataSet.Tables("AssetMaster").Rows.Item(curPosition).Item(19)) = False Then

[Code]....

View 9 Replies







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