小编San*_*upe的帖子

.Net File.GetLastAccessTime更新文件的上次访问时间

我们使用下面的行来获取文件的上次访问日期和时间.

DateTime dtLastAccesstime = File.GetLastAccessTime(sFilePath);
Run Code Online (Sandbox Code Playgroud)

但是我们面临着奇怪的问题,上面的调用本身会修改Last访问时间.因此,我们有效地将当前时间作为上次访问时间.

c# lastaccesstime

5
推荐指数
1
解决办法
2108
查看次数

Opacity = 1%有时会产生Win32Exception:没有足够的存储空间来处理此命令

我们的一个WinForm在Form.Show上给出了以下异常.表单的不透明度设置为1%.我们观察到,如果我们将Opacity设置为100%,则错误消失.当机器(非应用程序)长时间运行而没有重新启动时,通常会出现错误,通常在2天后发生.

例外详情如下:

System.ComponentModel.Win32Exception: Not enough storage is available to process this command
   at System.Windows.Forms.Form.UpdateLayered()
   at System.Windows.Forms.Form.OnHandleCreated(EventArgs e)
   at System.Windows.Forms.Control.WmCreate(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ContainerControl.WndProc(Message& m)
   at System.Windows.Forms.Form.WmCreate(Message& m)
   at System.Windows.Forms.Form.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
MessageNot enough storage is available to process this command
StackTrace   at System.Windows.Forms.Form.UpdateLayered()
   at System.Windows.Forms.Form.OnHandleCreated(EventArgs e)
   at System.Windows.Forms.Control.WmCreate(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ContainerControl.WndProc(Message& m)
   at System.Windows.Forms.Form.WmCreate(Message& m) …
Run Code Online (Sandbox Code Playgroud)

.net c#

1
推荐指数
1
解决办法
3971
查看次数

标签 统计

c# ×2

.net ×1

lastaccesstime ×1