lastmodified的名称在当前上下文中不存在 [英] The name lastmodified does not exist in current context

查看:55
本文介绍了lastmodified的名称在当前上下文中不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<pre lang="c#">private void textBox1_TextChanged(object sender, EventArgs e)
        {
            DateTime.LastModified = System.IO.File.GetLastWriteTime(@"C:\sinsdn38.ap.infineon.com\ArchView\03_Reports");

            Console.WriteLine(LastModified.ToString("dd/mm/yy HH:mm:ss")); 
        }





嗨。我有一个问题LastModified在目前的情况下并不存在。我如何定义lastmodified?



谢谢!



我的尝试:



更改文本框的名称?



Hi. I have an issue of "LastModified" does not exsit in current context. How do I go about defining lastmodified?

Thank you!

What I have tried:

Changing the name of the textbox?

推荐答案

您好,

按我的说法知识,DateTime没有这样的属性(LastModified)。

要获得文件的最后修改日期,你可以尝试下面的代码。

Hello,
As per my knowledge ,DateTime has no such property(LastModified).
To get last modified date of a file you can try below code.
DateTime lastModified = System.IO.File.GetLastWriteTime(@"C:\abcd.txt");
Console.WriteLine(lastModified.ToString("dd/MM/yy HH:mm:ss"));



谢谢


Thanks


这篇关于lastmodified的名称在当前上下文中不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆