比如:
把文件存成有 年月日 时间组成问文件:200512111235.jpg
这种格式的?

解决方案 »

  1.   

    楼主的问题看不太懂,是不是这个意思??? Dim str As String
     str = Now.ToString("yyyyMMddhhmm")
     Me.Label1.Text = str
      

  2.   

    简单,DATETIME有属性year,month,day,等,你可以获取着些属性,然后把它拼在一起就行了。
      

  3.   

    string fullfilename = this.myFile.PostedFile.FileName ; //提出上传文件名
    string filename=System.DateTime.Now.ToString("yyMMddhhmmss");
    string type=fullfilename.Substring(fullfilename.LastIndexOf(".")+1);
    filename+=".";
    filename+=type;
    //会生成200512111235.jpg这样的形式
      

  4.   

    using System.IO;string date = DateTime.Now.ToString("yyyyMMdd");
    string name = "文件名" + date;//你文件的名字
    HttpFileCollection files  = HttpContext.Current.Request.Files;
    HttpPostedFile postedFile = files[0];
    string sPath = Server.MapPath("../../Config/");//你要保存文件的路径
    System.IO.File.Delete(sPath + name);//如果上次的文件还存在,先删除文件
    postedFile.SaveAs(sPath + name);
      

  5.   

    同意楼上,"" + DateTime.Year + DateTime.Month + DateTime.Day + DateTime.Hour + DateTime.Minute + DateTime.Second
      

  6.   

    DateTime.Now.ToString( "yyyymmddhhmmss" )