This question already has answers here:
How to edit the modified date of a folder/file?
(2 answers)
Closed 4 years ago.
In my Local folder I have a file sample.txt.
On rightclick -> properties -> Details
I can see its modified date. For example 30.10.2018 09:00.
Can I change this property trough UWP? To 20.10.2018 09:00 for example.
Yes you can do it by the following way
string path = #"c:\sample.txt";
// Take an action that will affect the write time.
File.SetLastWriteTime(path, new DateTime(1985,4,3));
Related
This question already has answers here:
string.Replace (or other string modification) not working
(4 answers)
Closed 1 year ago.
how I update this data(In Image) for visualization
-------- "31-Jan" to "31 :: Jan"
Pls, guide me.
My Data
You can not change that format at database. Your expected format you can use for visualization purpose. From the databases level it save as what format you used in DDL(data definition language).
This question already has answers here:
How do I find the parent directory of a path?
(4 answers)
Closed 6 years ago.
I would like to cut last slash and corresponding file or folder given path in string variable (called pathVar)
For example, if pathVar = "c:\temp\a\b\c"
I would like to assign to newPathVar = "c:\temp\a\b"
What is the easier and best way in c# to do that?
Thanks!
You can use Path.GetDirectoryName for that.
This question already has answers here:
Getting Date or Time only from a DateTime Object
(7 answers)
Closed 8 years ago.
I know that, Example: DateTime fileCreatedDate = File.GetCreationTime(#"C:\Example\MyTest.txt");will return the date and time of a folder creation but how do I only get the "Date"Example "2014-12-01" or "Decemeber 12,2014" of the folder creation excluding the time?
You can use the DateTime.Date property for that, i.e. fileCreatedDate.Date.
This question already has answers here:
Check last modified date of file in C#
(5 answers)
Closed 9 years ago.
How do I read the modify date of the file in C#?
I can read the creation date of the file by using the code below:
ModifyDate = File.GetCreationTime(FilePath)
File.GetLastWriteTime will do the job
I believe you're looking for GetLastWriteTime
This question already has answers here:
How to display word differences using c#?
(4 answers)
Closed 2 years ago.
I have two strings.
stringV1 = "123456";
stringV2 = "102300456";
First I need to compare them.
If stringV2 has some changes, this new text should be highlighted like this:
"1'0'23'00'456"
this has been discussed here already sometimes...
How to highlight the differences between subsequent lines in a file?
How to display word differences using c#?
...
Use Diff algorithm for string comparision.