Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

select the path through c#

Posted on 2007-03-29
3
Medium Priority
?
238 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

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

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

What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
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…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…

604 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