将LastWriteTime与.txt进行比较 [英] Comparing LastWriteTime with .txt

查看:90
本文介绍了将LastWriteTime与.txt进行比较的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想比较计算机上的文件中的LastWriteTime和服务器上的.txt文件(例如http://www.vmr.cba.pl/VMR/config_date.txt),I有类似的东西,但它说日期不一样但是它是



Hey
I want to compare LastWriteTime from file on Computer with .txt file on server (for example http://www.vmr.cba.pl/VMR/config_date.txt), I have something like that but it say's that date isn't same however it is

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");

推荐答案

它说的是那个日期不一样,但它是



好​​的,请告诉我们你是如何确定它们是一样的。



您是否在代码中设置了断点,并逐字节检查这两个变量的内容?



假设内容为字符串相同,我想排除不太可能的假设:



1.你正在交易两个不同文本编码的字符串。



2.两个硬件上下文中存在不同的文化设置。
"it say's that date isn't the same however it is"

Okay, please tell us exactly how you determined they are the same.

Did you set a break-point in your code, and examine the contents of both variables byte-by-byte ?

Assuming the content of the strings are identical, I would want to rule out the unlikely hypotheses:

1. you are dealing with two strings that different text encodings.

2. a different "culture setting" exists on the two hardware contexts.


MM!=mm



由于解决方案太短,有一些文献:Lorem ipsum dolor sit amet,。 ..
"MM"!="mm"

Since the solution is too short, have some literature: Lorem ipsum dolor sit amet,...


test = test.ToString(...)


这篇关于将LastWriteTime与.txt进行比较的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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