DateTime.Now.ToString("yyyyMMddHHmmssfffffff")

解决方案 »

  1.   

    类TempFileCollection的AddExtentsion方法!
      

  2.   

    用GUID或者是用当前时间来做都可以。
      

  3.   

    GetTempFileName
    The GetTempFileName function creates a name for a temporary file. The filename is the concatenation of specified path and prefix strings, a hexadecimal string formed from a specified integer, and the .TMP extension.The specified integer can be nonzero, in which case, the function creates the filename but does not create the file. If you specify zero for the integer, the function creates a unique filename and creates the file in the specified directory.UINT GetTempFileName(
      LPCTSTR lpPathName,  // pointer to directory name for temporary 
                           // file
      LPCTSTR lpPrefixString,  // pointer to filename prefix
      UINT uUnique,        // number used to create temporary filename
      LPTSTR lpTempFileName 
                           // pointer to buffer that receives the new 
                           // filename
    );
      

  4.   

    用GUID或者是用当前时间来做都可以....
      

  5.   

    string filepath = "***";
    TempFileCollection tfc = new TempFileCollection(filepath,false);
    string filename = tfc.AddExtension("**",false);//文件类型名。
    返回的文件名即唯一的文件