Solved

select the path through c#

Posted on 2007-03-29
3
223 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 500 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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
JSON  parse help 8 52
Iteration Help (Asp.net VB) 5 36
bound data table problem 2 40
How to repeat the data 4 30
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

735 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