100分求够获取网络时间原理
不期望有可运行的代码,只求获取网络时间的原理及一些必要的示例程序.希望各位朋友能够慷慨相助,谢谢
------解决方案--------------------连接NTP 服务器
------解决方案--------------------http://www.codeproject.com/ 有代码
------解决方案--------------------用.NET实现RFC868协议获取网络时间 
 用.NET实现RFC868协议获取网络时间 
 昨天看CSDN上有人问如何在.NET下获取网络上某台服务器的时间,我查了一下描述网络时间协议的RFC868和RFC867。发觉并不难实现,当晚将其做成了.NET控件,并测试通过,拿出来与大家分享。               
        使用Socket类实现同服务器37端口的连接,建立连接后接收对方基于RFC868协议的二进制时间数据,将数据转换为.NET自身支持的DateTime类型,并转换为东8区时间。               
        主要实现代码为下面的函数:    
         ///  <summary>     
         /// 获取服务器的网络时间,并转换为东区时间    
         ///  </summary>     
         ///  <returns> 调用成果返回服务器的网络时间,失败返回System.DateTime.MinValue </returns>     
         public System.DateTime GetServerDateTime()    
         {    
             System.DateTime ret;    
             int nSize;          
             ret = System.DateTime.MinValue;          
             byte[] RecvBuf = new byte[1024];    
             //byte[] SendBuf = new byte[0];    
             RecvBuf.Initialize();          
             IPEndPoint ServerEp = new IPEndPoint(IPAddress.Parse(FServerAddress),FPort);          
             using (System.Net.Sockets.Socket Time_Socket = new Socket(AddressFamily.InterNetwork,    
                     SocketType.Stream,    
                     ProtocolType.IP))    
             {    
                 Time_Socket.Connect(ServerEp);    
                 //Time_Socket.Send(SendBuf);    
                 nSize = Time_Socket.Receive(RecvBuf);          
                 Time_Socket.Close();    
             }          
             if (nSize ==4)//接收到一个位的整型    
             {    
                 try    
                 {    
                     // 这里将byte数组转换为int类型    
                     int recvInt = BitConverter.ToInt32(RecvBuf, 0);          
                     // 这里转换网络字节序为主机字节序    
                     recvInt = System.Net.IPAddress.NetworkToHostOrder(recvInt);          
                     // 转换为真正的秒数    
                     uint ServerSecs = (uint)(recvInt);                            
                     // The ServerSecs is the number of seconds since 00:00 (midnight) 1 January 1900 GMT    
                     ret = DateTime.Parse( "1900-01-01 00:00:00 ");    
                     ret = ret.AddSeconds(ServerSecs);    
                     ret = ret.AddHours(8);  // 转换为东区时间          
                 }    
                 catch (Exception e)    
                 {    
                     Console.WriteLine(e.Message);    
                 }                        
             }          
             return ret;    
         }      
------解决方案--------------------找一个提供时间的页面get得到后也可以