如何从vb.net应用程序获取互联网时间 [英] how to get internet time from vb.net application

查看:96
本文介绍了如何从vb.net应用程序获取互联网时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用日期时间字段并从sql server获取以进行比较.
如果最终用户或黑客篡改了SQL计算机中的日期时间
如何在vb.net应用程序中获取互联网日期时间
这样我们就可以比较互联网时间和PC时间.

我是vb.net的新手

I use date time field and get from sql server for comparsion.
if end user or hackers tampered date time in sql machine
how to get internet date time in vb.net application
so that we can compare internet time and pc time.

i am new to vb.net
could you kindly help me in this situtation?

推荐答案

没有互联网时间"之类的东西.您可以从SNTP服务器获取当前时间.有一篇CodeProject文章提供了SNTP客户端类:

C#中的SNTP客户端 [
There''s no such thing as "internet time". You can get the current time from a SNTP server. There''s a CodeProject article that provides a SNTP client class:

SNTP Client in C#[^]

Once you retrieve the time from the desired SNTP server, you can compare that datetime to the datetime retrieved from your SQL server box.


这篇关于如何从vb.net应用程序获取互联网时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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