This article is a mirror article of machine translation, please click here to jump to the original article.

View: 449502|Reply: 174

[WinForm] .net/c# to set system time and JD time synchronization

  [Copy link]
Posted on 1/14/2018 12:57:20 PM | | | |


JD Time Synchronization Interface Address:The hyperlink login is visible.

The software calculates the HTTP send request to the end request, resulting in the network latency consumed
Windows System Time Synchronization Assistant
https://www.itsvse.com/thread-5314-1-1.html
(Source: Architect_Programmer)


Set the system time, call the function in the window API

SetLocalTime is used to set the current local time and date.
SetLocalTime();
Function: Set the current local time and date.
Syntax: BOOL WINAPI SetLocalTime( _In_ constSYSTEMTIME *lpSystemTime);
Parameter: lpSystemTime A pointer to the SYSTEMTIME structure that contains the new local date and time.
The SYSTEMTIME structure wDayOfWeek member is ignored.
Return value: If the function call is successful, the return value is a non-zero value.
If the function fails, the return value is zero. To get the extended error message, call the GetLastError function.
Remarks:
The calling process must have a privileged SE_SYSTEMTIME_NAME. This permission is disabled by default. The SetLocalTime feature enables SE_SYSTEMTIME_NAME permissions before changing the local time return and disabled permissions. For more information, see Run privileges.
The system uses internal UTC. Therefore, when you call SetLocalTime, the system takes the current time zone information for conversion, including daylight saving time settings. Note that the system uses daylight saving time to set the current time, not a new time. So, to ensure the correct result, the first call to SetLocalTime is called the second time, and the daylight saving time setting has now been updated.


The code is as follows:

The http request code is as follows:



Software Download:

Tourists, if you want to see the hidden content of this post, pleaseReply







Previous:.net/C# NumericUpDown control
Next:System.NotImplementedException:“未实现该方法或操作。”
 Landlord| Posted on 1/17/2018 1:50:00 PM |
ahu865 posted on 2018-1-17 13:17
Thank you for sharing... This interface is meaningful, I wrote before that JD.com added a regular order, but the time has not been accurate. Borrowing from you, I will spend my time ...

Haha, I also found this interface and code from other people's programs, and that person seems to be making some software that JD.com snapped up
Posted on 8/25/2019 4:58:47 PM |
Try to learn and learn

Posted on 9/28/2020 7:37:55 PM |

Try to learn and learn
Posted on 1/15/2018 2:24:30 AM |
Thank you for sharing
Posted on 1/15/2018 9:39:27 PM |
Thank you for sharing...
Posted on 1/17/2018 1:17:17 PM |
Thank you for sharing... This interface is meaningful, I wrote before that JD.com added a regular order, but the time has not been accurate. To borrow this from you, I put the time auto-calibration into my code.
Posted on 1/17/2018 3:12:42 PM |
Thank you for sharing new ideas
Posted on 1/18/2018 5:44:26 PM |
Learn to learn
Posted on 1/22/2018 5:44:01 PM |
There are big trees and Tmall
Posted on 1/22/2018 10:04:34 PM |
Let's take a look at the recovery
Posted on 1/23/2018 10:14:45 PM |
Software snap-ups are needed
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com