Net time command on CF.NET?

  • Thread starter Jared Miniman [MVP]
  • Start date
J

Jared Miniman [MVP]

Hi all,

Due to network security restrictions, we can only ping time servers on our
subnet via its hostname (rather than by IP address) by issuing the command
in the cmd prompt:

net time //computername

Can we somehow emulate this in CF.NET? What time sync support does CF.NET
provide? Any example code to be shared? Thanks for any help or suggestions
you can provide bearing in mind this "locked down" network.

--
_________________________________
Jared Miniman, MS-MVP Mobile Devices
Mobile Computer Consultant

ActiveSync problems?
http://www.microsoft.com/mobile/pocketpc/support/help/activesync.asp
Connection Mngr Q's?
http://www.microsoft.com/mobile/pocketpc/tutorials/connectionmanager
 
P

Paul G. Tobey [eMVP]

What version of the OS are we talking about? If CE.NET and if the time
service is running, you can send a DeviceIoControl() to the time service to
tell it to sync. I'm not sure if you can specify a server with a name that
isn't resolvable via DNS, though. At least, the time service is calling
gethostbyname() with the name specified in the registry...

Paul T.
 
C

Chris J.T. Auld [MVP]

I sync against server time by using a Web Service

Chris

--
****Please Reply To The Newsgroup So All Can Benefit From Discussion****
-------------------------------------------
Kognition Consulting Limited - Thought Meets Technology
Chris J.T. Auld - Managing Director
Microsoft MVP (Windows Mobile Devices)
Phone: +64 3 453 0064
Mobile: +64 21 500 239
Email: (e-mail address removed)
 
I

Ilya Tumanov [MS]

P

Paul G. Tobey [eMVP]

Oh sure, there's already one out there! Time to put my code away...

Paul T.

"Ilya Tumanov [MS]" said:
I would say SNTP (stands for Simple Network Time Protocol) is a far better
choose than FTP to synchronize time.

Here's a sample C# implementation:
http://www.codeproject.com/csharp/ntpclient.asp

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.
Subject: Re: Net time command on CF.NET?
Date: Wed, 11 Feb 2004 16:54:40 -0500
Lines: 57
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
NNTP-Posting-Host: pcp05117676pcs.summit01.nj.comcast.net 68.37.142.149
Path:
cpmsftngxa07.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP08
phx.gbl!TK2MSFTNGP09.phx.gbl
Xref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.framework.compactframework:45535
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

This is PPC 2003. Is there any way to leverage the FTP protocol to do this?

--
_________________________________
Jared Miniman, MS-MVP Mobile Devices
Mobile Computer Consultant

ActiveSync problems?
http://www.microsoft.com/mobile/pocketpc/support/help/activesync.asp
Connection Mngr Q's?
http://www.microsoft.com/mobile/pocketpc/tutorials/connectionmanager

service
to on
our
 
É

éric

the one suggested by Ilya is a good start but you will need to change from
udp to tcp if you want to sync time via active sync. also this is not an
async call and there is no timeout so it ends up hanging if the server is
not found.

send me an email if you want my adaptation of the code to make async.

Regards

éric

Paul G. Tobey said:
Oh sure, there's already one out there! Time to put my code away...

Paul T.

"Ilya Tumanov [MS]" said:
I would say SNTP (stands for Simple Network Time Protocol) is a far better
choose than FTP to synchronize time.

Here's a sample C# implementation:
http://www.codeproject.com/csharp/ntpclient.asp

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.
Subject: Re: Net time command on CF.NET?
Date: Wed, 11 Feb 2004 16:54:40 -0500
Lines: 57
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
NNTP-Posting-Host: pcp05117676pcs.summit01.nj.comcast.net 68.37.142.149
Path:
cpmsftngxa07.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP08 servers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top