1.11M Members

Copy File using file name concept

 
0
 

Hello,

I would like to seek help from all experts in VB.NET (VB Language) regarding copying file from source folder to destination folder.

I have a files named YYYYMMDDHHMMSS.txt. Now i want to build a small project to copy those file to destination folder. The project should work in following manner:

  1. Check Computer Date
  2. Look for the file in destination folder similar to computer date and then copy that file to destination folder. For example:
    Let say Computer Date is 26/12/2012. When the program starts, it should check the computer date and then look for the file named 20121226*.txt. If the file is present then it should start copying else it should give a message saying the file does not exists.
  3. It should create log file storing the copy information.

Can any one help me how to have above feature in my project.

Thanks

 
0
 

Till now how far you wrote code for this? You want someone to write code for you?

 
0
 

That is not a question, that is a specification. As stated above, show what you have tried and described what is giving you problems.

 
0
 

try these articles as a starting point:
Click Here
Click Here

 
0
 

For the date use the Date.Today() function.

To take the date from the format dd/mm/yyyy and put it in the form ddmmyyyy you will need to build a new string like this Date.Today.Day & Date.Today.Month & Date.Today.Year

To check if a file exists you need to use the System.IO.File.Exists(path) function

Hope this helps. Should be enough to complete your task

 
0
 

Simpler way is

Date.Today.ToString("yyyyMMdd")
 
0
 

Thanks Experts for the help. I got the answer.

Question Answered as of 1 Year Ago by Pgmer, tinstaafl, Reverend Jim and 2 others
You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article