Retrieving Date & Time from a web server (localhost)
- From: teo <teo@xxxxxxxxx>
- Date: Mon, 14 Apr 2008 21:52:46 +0200
I'm developing a software (a WinApp, not a WebApp)
to retrieve Date & Time from a web server,
but firstly I need to to test it on my PC, with "localhost"
I'm using the VB Net language
(below two different code approaches),
I'm with XP Sp2 and IIS
(all IIS http and ftp tasks regularly work)
I have no firewall
I think it maybe a matter of Service enabling
(maybe involving the port 13...)
Any attempt fail.
1 approach)
using the following VB Net API
Private Declare Unicode Function NetRemoteTOD Lib "netapi32" ( _
<MarshalAs(UnmanagedType.LPWStr)> ByVal ServerName As String, _
ByRef BufferPtr As IntPtr) As Integer
the entire example here:
http://www.codeproject.com/KB/vb/NetRemoteTOD.aspx?fid=31067&df=90&mpp=25&noise=3&sort=Position&view=Quick&select=707715#xx707715xx
tried using
"localhost"
"http//localhost"
"127.0.0.1"
but always got 00.00.00.00
2 approach)
using this VB Net command
Dns.GetHostByName("localhost")
it seems to work because no error occurs
(if I wrote "localhostSharonStone" an error occurs),
but the very next command it does fail:
objTcpClient.Connect("localhost", 13)
it says (translated into English)
"Impossible to establish a connection. The addressed computer
keeps on refusing".
Any hint?
.
- Follow-Ups:
- Prev by Date: how can the website work fine in VS but not in deploy???
- Next by Date: Re: Retrieving Date & Time from a web server (localhost)
- Previous by thread: how can the website work fine in VS but not in deploy???
- Next by thread: Re: Retrieving Date & Time from a web server (localhost)
- Index(es):
Relevant Pages
|