try
{
FbDataAdapter daa = new FbDataAdapter();///////////////////time :1.00 to 9.00
string da = DateTime.Now.ToString();
string date = da.Substring(0, 2);
string date1 = da.Substring(3, 4 - 2);
string date2 = da.Substring(6, 9 - 5);
string daietime = "D" + date + "M" + date1 + "Y" + date2;
int f = da.IndexOf(":");
int l = da.Length;
string main = da.Substring(11, f - 11);
string refer = da.Substring(13, f - 10);
string refer1 = da.Substring(16, f - 10);
string refer2 = da.Substring(19, f - 10);
string time = "H" + main + "M" + refer + "S" + refer1 + "S" + refer2;
// uploadedfilename means FileUpload Control
uploadedfilename.SaveAs(@Request.PhysicalApplicationPath + "images\\"+ daietime + time + Path.GetExtension(uploadedfilename.FileName));
}
catch
{
string da = DateTime.Now.ToString();//////////////////////// Time :10.00 to 12.00
string date = da.Substring(0, 2);
string date1 = da.Substring(3, 4 - 2);
string date2 = da.Substring(6, 9 - 5);
string daietime = "D" + date + "M" + date1 + "Y" + date2;
int f = da.IndexOf(":");
int l = da.Length;
string main = da.Substring(11, f - 11);
string refer = da.Substring(14, f - 11);
string refer1 = da.Substring(17, f - 11);
string refer2="";
string time="";
try
{
refer2 = da.Substring(20, f - 11);
time = "H" + main + "M" + refer + "S" + refer1 + "S" + refer2;
}
catch
{
refer2 = "H" + main + "M" + refer + "S" + refer1;
time = "H" + main + "M" + refer + "S" + refer1 + "S" + refer2;
}
uploadedfilename.SaveAs(@Request.PhysicalApplicationPath + "images\\"+ daietime + time + Path.GetExtension(uploadedfilename.FileName));
}