Sir,
I am trying to export excel sheet using C#.net and also need excel sheet name like year with datetime.
I have tried below c# code but can not getting date like this, ie;
I want output, string strfilename = "06/24/2016-8:32:45.126 AM";
DateTime filename = DateTime.Now;
string strfilename = filename.ToString("yyyyMMddHHmmss");
Kindly replay me.
Regards,
Abhilash.J.A
Loading


Vinay SinghRank #604 · 4K reputationPosted Jun 23, 2016, 11:09 PM EDT
Akshay PhadkeRank #161 · 14.6K reputationPosted Jun 24, 2016, 1:22 AM EDT
Akshay PhadkeRank #161 · 14.6K reputationPosted Jun 24, 2016, 6:40 AM EDT
stringfilename = Path.GetFileName(FileUploadControl.FileName);FileUploadControl.SaveAs(Server.MapPath("~/upload") + filename);Abhilash J ARank #1,243 · 1.4K reputationPosted Jun 23, 2016, 11:48 PM EDT
string strfilename = filename.ToString("dd/MM/yyyy-hh:mm:ss tt");
string p = @"E:/File/Graph" + strfilename + ".xls";
System.IO.FileInfo filepp = new System.IO.FileInfo(p);
Abhilash J ARank #1,243 · 1.4K reputationPosted Jun 24, 2016, 4:06 AM EDT
string strfilename = filename.ToString("yyyy/MM/dd/HH:mm:ss") + ".xls";
string path = @"E:/File/Graph";
string p = Path.Combine(path, strfilename);
System.IO.FileInfo filepp = new System.IO.FileInfo(p);
The given path's format is not supported
Vinoth RajendranRank #74 · 25K reputationPosted Jun 24, 2016, 4:42 AM EDT
Ehsan SajjadRank #512 · 4.8K reputationPosted Jun 24, 2016, 6:42 AM EDT