如何改变一下文件的文件名??

解决方案 »

  1.   

    if RenameFile('c:\2.txt','c:\1.txt') then showmessage('we');
    RenameFile(原文件名,新文件名),成功返回true,否则返回false.
      

  2.   

    看看帮助吧
    Procedure or function
    Description
    Append Opens an existing text file for appending.
    AssignFile Assigns the name of an external file to a file variable.
    BlockRead Reads one or more records from an untyped file.
    BlockWrite Writes one or more records into an untyped file.
    ChDir Changes the current directory.
    CloseFile Closes an open file.
    Eof Returns the end-of-file status of a file.
    Eoln Returns the end-of-line status of a text file.
    Erase Erases an external file.
    FilePos Returns the current file position of a typed or untyped file.
    FileSize Returns the current size of a file; not used for text files.
    Flush Flushes the buffer of an output text file.
    GetDir Returns the current directory of a specified drive.
    IOResult Returns an integer value that is the status of the last I/O function performed.
    MkDir Creates a subdirectory.
    Read Reads one or more values from a file into one or more variables.
    Readln Does what Read does and then skips to beginning of next line in the text file.
    Rename Renames an external file.
    Reset Opens an existing file.
    Rewrite Creates and opens a new file.
    RmDir Removes an empty subdirectory.
    Seek Moves the current position of a typed or untyped file to a specified component. Not used with text files.
    SeekEof Returns the end-of-file status of a text file.
    SeekEoln Returns the end-of-line status of a text file.
    SetTextBuf Assigns an I/O buffer to a text file.
    Truncate Truncates a typed or untyped file at the current file position.
    Write Writes one or more values to a file.
    Writeln Does the same as Write, and then writes an end-of-line er to the text file.