यह काम करने के लिए लगता है:
using System;
using System.Runtime.InteropServices;
namespace ClockResync
{
class Program
{
[DllImport("w32time.dll")]
public static extern uint W32TimeSyncNow([MarshalAs(UnmanagedType.LPWStr)]String computername, bool wait, uint flag);
static void Main(string[] args)
{
Console.WriteLine(W32TimeSyncNow("computername", true, 8).ToString());
Console.ReadLine();
}
}
}
यह undocumented है तो मैं बिल्कुल यकीन है कि क्या संभव झंडे हैं नहीं कर रहा हूँ, लेकिन 8 काम ठीक करने के लिए लगता है - अपने सिस्टम घड़ी के साथ परीक्षण किया गया। यदि आप Windows 64-बिट चला रहे हैं, तो 64-बिट के लिए संकलित करें या आपको उल्लंघन उल्लंघन अपवाद मिलेंगे।
W32TimeQueryStatus
अंतिम सफल सिंक समय प्राप्त करने में सक्षम होना चाहिए। जब मैं अधिक समय लेता हूं तो मैं उस पर काम करूंगा।
स्रोत
2016-07-13 00:39:44
बिल्कुल वही नहीं जो मुझे चाहिए, लेकिन कुछ भी नहीं। धन्यवाद! –
धन्यवाद दस लाख! –