【发布时间】:2015-10-24 18:29:58
【问题描述】:
我想比较计算机上的文件中的 LastWriteTime 和服务器上的 .txt 文件(例如 http://www.vmr.cba.pl/VMR/config_date.txt),我有类似的东西,但它说日期不一样,但它是
WebClient Download = new WebClient();
string serwer_date = Download.DownloadString("http://www.vmr.cba.pl/VMR/config_date.txt");
string DateServer = serwer_date;
path = "yo.txt";
DateTime test = new DateTime();
test = File.GetLastWriteTime(path);
test.ToString("dd-MM-yy-HH:MM");
if (String.Equals(test, DateServer))
{
MessageBox.Show("No cheat");
}
else
{
MessageBox.Show("cheat ;c");
【问题讨论】:
-
可能与时区有关。MSDN 声明返回时间是当地时间。