Re: Retrieving Date & Time from a web server (localhost)



On Mon, 14 Apr 2008 13:02:22 -0700 (PDT), jojoba@xxxxxxxxx wrote:

On Apr 14, 12:52 pm, teo <t...@xxxxxxxxx> wrote:
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&mp...

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?

sorry, but what exactly isnt working?
u running a webservice in your ide, and it fails?

the code here, tested online with a real server,
it does work:
http://www.codeproject.com/KB/vb/NetRemoteTOD.aspx?fid=31067&df=90&mp...

but if I locally tested it, writing "localhost",
like this
dRemoteDate = GetNetRemoteTOD("localhost")

always returns 00.00.00.00

note:
also tested it writing
"localhost"  
"http//localhost"  
"127.0.0.1"

.



Relevant Pages

  • Re: Retrieving Date & Time from a web server (localhost)
    ... to retrieve Date & Time from a web server, ... but firstly I need to to test it on my PC, with "localhost" ... using the following VB Net API ... but if I locally tested it, writing "localhost", ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Cannot access localhost under Windows XP Service Pack 2
    ... with this setting I can access simple html with localhost. ... "Visual Studio cannot create or open the application because the Web server ... Or is the event log ... >> I also deactivated the Windows Firewall and rebooted the system, ...
    (microsoft.public.inetserver.iis)
  • vs2005 debugging on ws2k3 server
    ... I get the error "Unable to start debugging on the web server. ... good for localhost so they must be for any site on the local machine. ... NETWORK SERVICES and my user account - to no avail. ...
    (microsoft.public.dotnet.framework.aspnet)
  • deploying asp.net app
    ... i made a very simple form with some input that queries a oracle db and returns dataset to a datagrid. ... and it works fine when it sits resident on the localhost. ... but, when i xcopy the files to the web server and then set up a virtual directory on that machine, it seems all that shows up in explorer are the lablel tags. ... i changed the web config from debug="true" to false ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Retrieving Date & Time from a web server (localhost)
    ... but firstly I need to to test it on my PC, with "localhost" ... (all IIS http and ftp tasks regularly work) ... Any attempt fail. ... using this VB Net command ...
    (microsoft.public.dotnet.framework.aspnet)