Solved

select the path through c#

Posted on 2007-03-29
3
214 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
  • 2
3 Comments
 
LVL 11

Expert Comment

by:Babycorn-Starfish
Comment Utility
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
Comment Utility
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
Comment Utility
thanks man.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Query datatable in LINQ 6 39
GridDataView 6 44
Windows Management Instrument 6 57
index Out OF Range Exception error 4 25
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
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 tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

763 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now