Professional Web Applications Themes

ASPPing problem - ASP Components

I am trying to make a VBScript in an ASP which uses ASPPing ([url]http://www.15seconds.com/component/pg000229.htm[/url]) to ping a remote host and show whether the host is alive. However, I cannot get ASPPing to work properly. I always get an empty string in the code below. But if I run the script with wscript in a command shell it works fine. I am running WinXP, IIS5.1 with anonymous access. <% Set Pinger = Server.CreateObject("AspPing.Conn") Pinger.RemoteHost = "www.google.com" Pinger.PingCount = 5 result = Pinger.Ping Set Pinger = nothing %> Regards Morten Frederiksen...

  1. #1

    Default ASPPing problem

    I am trying to make a VBScript in an ASP which uses ASPPing
    ([url]http://www.15seconds.com/component/pg000229.htm[/url]) to ping a remote host and
    show whether the host is alive. However, I cannot get ASPPing to work
    properly. I always get an empty string in the code below. But if I run the
    script with wscript in a command shell it works fine.

    I am running WinXP, IIS5.1 with anonymous access.

    <%
    Set Pinger = Server.CreateObject("AspPing.Conn")
    Pinger.RemoteHost = "www.google.com"
    Pinger.PingCount = 5
    result = Pinger.Ping
    Set Pinger = nothing
    %>

    Regards
    Morten Frederiksen


    Morten Frederiksen Guest

  2. #2

    Default Re: ASPPing problem

    Not that this is an answer to your question, but you could always do the
    componentless ping:

    response.write ping("127.0.0.1")

    '''From Michael Harris post in vbscript group 7/28/03
    function ping(arg)
    with Server.createobject("wscript.shell")
    ping = Not CBool(.run("ping -n 1 " & arg,0,true))
    end with
    end function


    Note that many remote hosts will not respond to a ping, so I wouldn't use
    this as a definitive test.

    Ray at work





    "Morten Frederiksen" <mailno.spam> wrote in message
    news:4123a0c9$0$13799$ba624c82nntp05.dk.telia.net ...
    >I am trying to make a VBScript in an ASP which uses ASPPing
    > ([url]http://www.15seconds.com/component/pg000229.htm[/url]) to ping a remote host
    > and
    > show whether the host is alive. However, I cannot get ASPPing to work
    > properly. I always get an empty string in the code below. But if I run the
    > script with wscript in a command shell it works fine.
    >
    > I am running WinXP, IIS5.1 with anonymous access.
    >
    > <%
    > Set Pinger = Server.CreateObject("AspPing.Conn")
    > Pinger.RemoteHost = "www.google.com"
    > Pinger.PingCount = 5
    > result = Pinger.Ping
    > Set Pinger = nothing
    > %>
    >
    > Regards
    > Morten Frederiksen
    >
    >

    Ray at Guest

  3. #3

    Default Re: ASPPing problem

    "Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> skrev i en
    meddelelse news:OK2lWOfhEHA.2916TK2MSFTNGP12.phx.gbl...
    > Not that this is an answer to your question, but you could always do the
    > componentless ping:
    >
    > response.write ping("127.0.0.1")
    >
    > '''From Michael Harris post in vbscript group 7/28/03
    > function ping(arg)
    > with Server.createobject("wscript.shell")
    > ping = Not CBool(.run("ping -n 1 " & arg,0,true))
    > end with
    > end function
    Thanks, but I already found similar code on the web. Unfortunately it does
    not work from ASP, since the Run method tries to open a window, which is not
    allowed.
    > Note that many remote hosts will not respond to a ping, so I wouldn't use
    > this as a definitive test.
    I am only going to ping host on an intranet, so I know they will respond if
    they are up.

    Regards
    Morten Frederiksen


    Morten Frederiksen Guest

  4. #4

    Default Re: ASPPing problem

    Did you try this code? And are you familiar with the .Run method? The
    second argument, in this case 0, is the intWindowStyle. 0 means that no
    window will be displayed. The code below will work fine. Try it.

    Ray at work

    "Morten Frederiksen" <mailno.spam> wrote in message
    news:4124ca5e$0$8707$ba624c82nntp04.dk.telia.net. ..
    > "Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> skrev i en
    > meddelelse news:OK2lWOfhEHA.2916TK2MSFTNGP12.phx.gbl...
    >> Not that this is an answer to your question, but you could always do the
    >> componentless ping:
    >>
    >> response.write ping("127.0.0.1")
    >>
    >> '''From Michael Harris post in vbscript group 7/28/03
    >> function ping(arg)
    >> with Server.createobject("wscript.shell")
    >> ping = Not CBool(.run("ping -n 1 " & arg,0,true))
    >> end with
    >> end function
    >
    > Thanks, but I already found similar code on the web. Unfortunately it does
    > not work from ASP, since the Run method tries to open a window, which is
    > not
    > allowed.
    >
    >> Note that many remote hosts will not respond to a ping, so I wouldn't use
    >> this as a definitive test.
    >
    > I am only going to ping host on an intranet, so I know they will respond
    > if
    > they are up.
    >
    > Regards
    > Morten Frederiksen
    >
    >

    Ray at Guest

  5. #5

    Default Re: ASPPing problem

    "Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> skrev i en
    meddelelse news:O96ZFwghEHA.2340TK2MSFTNGP11.phx.gbl...
    > Did you try this code? And are you familiar with the .Run method? The
    > second argument, in this case 0, is the intWindowStyle. 0 means that no
    > window will be displayed. The code below will work fine. Try it.
    I have tried and it did not work. The web server hangs as usual. (See my
    post in nntp://microsoft.public.inetserver.asp.general)

    I am new to ASP and VBScript (though I have experience with several other
    programming languages), so I would have to say that I am not exactly
    familiar with the Run method. I did, however, consult the doentation on
    MSDN where the value 0 is defined to mean "hide the window and activate
    another window"---which I think is pretty vague.

    But thanks anyway.

    Regards
    Morten Frederiksen


    Morten Frederiksen Guest

Similar Threads

  1. contribute problem - access denied file may not existpermission problem
    By Al1973 in forum Macromedia Contribute Connection Administrtion
    Replies: 6
    Last Post: September 17th, 04:16 PM
  2. Replies: 2
    Last Post: September 30th, 12:13 PM
  3. Replies: 0
    Last Post: August 23rd, 11:56 AM
  4. Replies: 0
    Last Post: August 2nd, 03:03 PM
  5. Replies: 2
    Last Post: July 17th, 07:27 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139