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

Ehsan SajjadPosted Jun 24, 2016, 10:42 AM
Akshay PhadkePosted Jun 24, 2016, 10:40 AM
stringfilename = Path.GetFileName(FileUploadControl.FileName);FileUploadControl.SaveAs(Server.MapPath("~/upload") + filename);Vinoth RajendranPosted Jun 24, 2016, 8:42 AM
Abhilash J APosted Jun 24, 2016, 8:06 AM
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
Akshay PhadkePosted Jun 24, 2016, 5:22 AM
Abhilash J APosted Jun 24, 2016, 3:48 AM
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);
Vinay SinghPosted Jun 24, 2016, 3:09 AM