string oldname = FileUpload1.FileName; //只是获得了文件名+扩展名,没有取得路径名字
string newname = oldname.Substring(0, oldname.LastIndexOf(".")) + " " +
DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString() +
DateTime.Now.Day.ToString() + DateTime.Now.Hour.ToString() +
DateTime.Now.Minute.ToString() + DateTime.Now.Second.ToString() +
DateTime.Now.Millisecond.ToString() +
oldname.Substring(oldname.LastIndexOf("."), oldname.Length - oldname.LastIndexOf("."));
oldname.LastIndexOf("."):截止到某个符号的字符长度!!!!