本文介绍了如果经过特定天数,则触发操作VB.NET的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面的代码已经可以使用了,但是仅适用于Filesystem.FileDateTime,为此我需要一个文件,但是当我用日期字符串替换它时,即使我发现filedatetime的datemethod与其相同,也无法使用我写Now.ToString时将返回.

WORKS;

This code below works already, but only with Filesystem.FileDateTime, and for this i need a file, but it doesnt work when i replace it with a date string even i found out that the datemethod of filedatetime the same is as it will be returned when i write Now.ToString.

WORKS;

If DateDiff("d", FileSystem.FileDateTime("C:\example.ini"), Now) > 15 Then
MsgBox("The Free Version reached the Free Limit of 15 Days") : Else : End If



不工作;



DOESNT WORK;

If DateDiff("d", 1.5.2012 12.00.00MD, Now) > 15 Then
MsgBox(""): Else : End If



我是否必须将其声明为日期或字符串,还是想念其他东西?
这是非常困难的,因为要证明正确的解决方案,我必须至少等待一天.提前谢谢!

已添加代码标签-LOSMAC [/EDIT]



Do i have to declare it as date or as string or did i miss something else?
This is very difficult since to prove the right solution i must wait at least one day. Thanks in advance!

Code tags added - LOSMAC[/EDIT]

推荐答案

If DateDiff("d", new System.DateTime(2012,5,1,12,0,0), Now) > 15 Then
MsgBox(""): Else : End If



这篇关于如果经过特定天数,则触发操作VB.NET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-23 01:20