?
Solved

select the path through c#

Posted on 2007-03-29
3
Medium Priority
?
232 Views
Last Modified: 2013-12-17
i need this very urgent,
i hv the problem,like i hv to update file and the file is located in c:/folder/folder/march19/filename.this march19/filename will be changing everyday like if today's date is like march30th,the filename will be like march29/filename.filename is same all the time and only the date folder will be changing everyday.
this i hv to write a batch process whenever the file comes in the day........i hv to update the file .
please help me out to write code that always looks that folder like today-1..........urgent,urgent.thanks
0
Comment
Question by:hariprasadere
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 11

Expert Comment

by:Babycorn-Starfish
ID: 18820913
Hi,

try this

         String[] dateParts = DateTime.Now.ToLongDateString().Split(' ');
           
        String path = @"C:/folder/folder/" + dateParts[1] + dateParts[0]+ "/filename";
   
obviously substitute folder and filename with the real bits of your path.

hope this helps
0
 
LVL 11

Accepted Solution

by:
Babycorn-Starfish earned 1500 total points
ID: 18820916
oh hang on...

let me just change that to....

 String[] dateParts = DateTime.Now.ToLongDateString().Split(' ');
           
String path = @"C:/folder/folder/" + dateParts[1].ToLower() + dateParts[0]+ "/filename";
0
 

Author Comment

by:hariprasadere
ID: 18830865
thanks man.
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question