SoFunction
Updated on 2025-03-06

C# methods to simply read, change file creation, modification and access time

C# methods to simply read, change file creation, modification and access time

Updated: July 24, 2015 16:00:06 Author: DTC2
This article mainly introduces C#'s simple reading, changing the creation, modification and access time of files, and involves the relevant usage techniques of C# file classes SetCreationTime, SetLastWriteTime and SetLastAccessTime. Friends who need it can refer to it

This article describes the methods of C# to simply read, change the creation, modification and access time of files. Share it for your reference. The details are as follows:

FileInfo fi = new FileInfo("C:\\");
(());
(());
(());
// Change the creation, modification, and access time of (setting) files("C:\\", (-1));
("C:\\", (-2));
("C:\\", (-3));

I hope this article will be helpful to everyone's C# programming.

  • C#
  • document
  • time

Related Articles

  • Extract all tables from PDF document in C#/

    This article mainly introduces all tables extracted from PDF documents in C#/. The article focuses on the topic and has certain reference value. Friends who need it can refer to it.
    2022-08-08
  • How to get absolute value function in C#

    This article mainly introduces functions that take absolute values ​​in C#. It has good reference value. Let's take a look with the editor below
    2017-03-03
  • c# algorithm code for obtaining the same probability random number

    This article mainly introduces the algorithm code for obtaining the same probability random number. Friends who need it can refer to it.
    2014-01-01
  • Detailed explanation of commonly used matches for Regex in C# regular expressions

    This article mainly introduces the common matching of C# regular expression Regex. Use the Regex class to implement verification. Interested friends can refer to it.
    2015-12-12
  • Virtual function virtual in C#

    This article introduces virtual function virtual in C#, and the article introduces it in detail through sample code. It has certain reference value for everyone's study or work. Friends who need it can refer to it.
    2022-04-04
  • C# asynchronous programming from shallow to deep (second) use of Async/Await

    This article mainly introduces the role of Async/Await from shallow to deep (2). This article introduces you very detailed through the example code, which has certain reference value for your study or work. Friends who need it can refer to it.
    2022-03-03
  • Detailed explanation of how C# uses TcpListener and TcpClient to implement Tcp communication

    TcpListener and TcpClient are further encapsulation based on the class, and use the GetStream method to return the network stream. Let's take a closer look at how to use TcpListener and TcpClient to implement Tcp communication.
    2023-12-12
  • UnityShader3 realizes rotation and cooling effects

    This article mainly introduces the effect of UnityShader3 in detail to realize the rotation and cooling effect. The sample code in the article is introduced in detail and has certain reference value. Interested friends can refer to it.
    2019-03-03
  • Detailed explanation Unity uses ParticleSystem particle system to simulate the flow of potions in blood vessels (particle collision)

    This article mainly introduces Unity's use of ParticleSystem particle system to simulate the flow of potions in blood vessels (particle collision). This article introduces you very detailedly and has certain reference value for your study or work. Friends who need it can refer to it.
    2021-05-05
  • How to design scrolling subtitles in C#

    The text positions in ordinary forms are fixed, but in some forms, the text needs to be moved, such as some highly advertising interfaces that require some scrolling subtitles, so this article introduces to you how to design scrolling subtitles in C# in the form. Friends who need it can refer to it.
    2024-04-04

Latest Comments