Is "webBrowser.Navigate" a good way to continually check if a pageexists?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Alan

    Is "webBrowser.Navigate" a good way to continually check if a pageexists?

    Hello,

    I need to write a systemtray program to check every minute if a
    certain intranet page exists. Would "webBrowser.Nav igate" and catching
    exceptions to it be a good choice in terms of load on the PC?

    If the page exists, the program should load and display it. The
    program would run on a couple of thousand PCs and the idea is to have
    a very basic, one-to-many instant message.

    Thanks,

    - Alan.
  • =?ISO-8859-1?Q?G=F6ran_Andersson?=

    #2
    Re: Is "webBrowse r.Navigate&quot ; a good way to continually check if apage exists?

    Alan wrote:
    Hello,
    >
    I need to write a systemtray program to check every minute if a
    certain intranet page exists. Would "webBrowser.Nav igate" and catching
    exceptions to it be a good choice in terms of load on the PC?
    >
    If the page exists, the program should load and display it. The
    program would run on a couple of thousand PCs and the idea is to have
    a very basic, one-to-many instant message.
    >
    Thanks,
    >
    - Alan.
    What would the reason be for the page not to exist? It would be much
    easier if the page always exists, both for the server and the clients.

    --
    Göran Andersson
    _____
    Göran Anderssons privata hemsida.

    Comment

    • Cor Ligthert[MVP]

      #3
      Re: Is "webBrowse r.Navigate&quot ; a good way to continually check if a page exists?

      Alan,

      I preffer for this kind of stuff the HTTP classes



      Cor


      "Alan" <bruguy@gmail.c omschreef in bericht
      news:6651761b-0668-436f-bcf6-5eb8708ad64d@c5 8g2000hsc.googl egroups.com...
      Hello,
      >
      I need to write a systemtray program to check every minute if a
      certain intranet page exists. Would "webBrowser.Nav igate" and catching
      exceptions to it be a good choice in terms of load on the PC?
      >
      If the page exists, the program should load and display it. The
      program would run on a couple of thousand PCs and the idea is to have
      a very basic, one-to-many instant message.
      >
      Thanks,
      >
      - Alan.

      Comment

      • Patrice

        #4
        Re: Is &quot;webBrowse r.Navigate&quot ; a good way to continually check if a page exists?

        I'm rather worried with server side as you'll receive thousands of request
        each minute to check for this page...

        AFAIK using System.Net.Sock et should allow to use (rather than fake) instant
        messaging to notify the client side application that the intranet page is
        available and should be displayed.

        --
        Patrice

        "Alan" <bruguy@gmail.c oma écrit dans le message de groupe de discussion :
        6651761b-0668-436f-bcf6-5eb8708ad64d...l egroups.com...
        Hello,
        >
        I need to write a systemtray program to check every minute if a
        certain intranet page exists. Would "webBrowser.Nav igate" and catching
        exceptions to it be a good choice in terms of load on the PC?
        >
        If the page exists, the program should load and display it. The
        program would run on a couple of thousand PCs and the idea is to have
        a very basic, one-to-many instant message.
        >
        Thanks,
        >
        - Alan.

        Comment

        • Alan

          #5
          Re: Is &quot;webBrowse r.Navigate&quot ; a good way to continually check if apage exists?

          Thanks to all.

          Göran, if the page exists, that would mean there is a message to
          display. No page, no message.

          Cor, I'll check out the link.

          Patrice, I'll check out sockets too. But I want to keep it really
          simple and sockets would mean establishing a permanent connection from
          each client - plus coding a custom server component too?

          I'm thinking of having each client check once a minute so the average
          should be 1,000 checks a minute. I have a powerful web server which is
          used very little. I was thinking for looking for the presence of a
          text file in a network share instead, but I think a web server would
          handle the load better.


          On Jun 6, 7:30 pm, "Patrice" <http://www.chez.com/scribe/wrote:
          I'm rather worried with server side as you'll receive thousands of request
          each minute to check for this page...
          >
          AFAIK using System.Net.Sock et should allow to use (rather than fake) instant
          messaging to notify the client side application that the intranet page is
          available and should be displayed.
          >
          --
          Patrice
          >
          "Alan" <bru...@gmail.c oma écrit dans le message de groupe de discussion :
          6651761b-0668-436f-bcf6-5eb8708ad...@c5 8g2000hsc.googl egroups.com...
          >
          Hello,
          >
          I need to write a systemtray program to check every minute if a
          certain intranet page exists. Would "webBrowser.Nav igate" and catching
          exceptions to it be a good choice in terms of load on the PC?
          >
          If the page exists, the program should load and display it. The
          program would run on a couple of thousand PCs and the idea is to have
          a very basic, one-to-many instant message.
          >
          Thanks,
          >
          - Alan.

          Comment

          • =?ISO-8859-1?Q?G=F6ran_Andersson?=

            #6
            Re: Is &quot;webBrowse r.Navigate&quot ; a good way to continually check if apage exists?

            Alan wrote:
            Göran, if the page exists, that would mean there is a message to
            display. No page, no message.
            Yes, but why does the page have to be missing just because there is no
            message? The page could just be an empty page when there is no message.

            The server always returns a page for every request; if the requested
            page doesn't exist, the server returns an error page instead. The fact
            that there is no message doesn't mean that there is something wrong, so
            it doesn't feel right to create an error condition for that.

            Also, to handle a missing page, the client has to distinguish between
            different error pages, to determine if it's just a missing message that
            is causing an error page to be returned, or if it's a real error.
            I'm thinking of having each client check once a minute so the average
            should be 1,000 checks a minute. I have a powerful web server which is
            used very little.
            I suggest that you add a random factor to the delay, so that you don't
            risk to get hundreds of requests at the same time every minute.
            I was thinking for looking for the presence of a
            text file in a network share instead, but I think a web server would
            handle the load better.
            Yes, you would probably get problems with a network share when the
            server is trying to write to the file at the same time as several users
            are trying to read it.


            --
            Göran Andersson
            _____
            Göran Anderssons privata hemsida.

            Comment

            • Herfried K. Wagner [MVP]

              #7
              Re: Is &quot;webBrowse r.Navigate&quot ; a good way to continually check if a page exists?

              "Alan" <bruguy@gmail.c omschrieb:
              I need to write a systemtray program to check every minute if a
              certain intranet page exists. Would "webBrowser.Nav igate" and catching
              exceptions to it be a good choice in terms of load on the PC?
              >
              If the page exists, the program should load and display it. The
              program would run on a couple of thousand PCs and the idea is to have
              a very basic, one-to-many instant message.
              I suggest to take a look at 'WebClient' and 'HttpWebRequest '.

              --
              M S Herfried K. Wagner
              M V P <URL:http://dotnet.mvps.org/>
              V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

              Comment

              • Alan

                #8
                Re: Is &quot;webBrowse r.Navigate&quot ; a good way to continually check if apage exists?

                I see your point.

                My original idea was that if there was simply no page, then there was
                nothing to do. If there's always a page, then the client has to
                download it, read its contents and decide whether to display it or
                not.

                Your idea is probably better because I also need a way to decide if
                the page has been displayed before. I can do that if I'm already
                parsing the contents.

                And thanks for the random factor, that's a very good idea indeed.


                On Jun 6, 10:14 pm, Göran Andersson <gu...@guffa.co mwrote:
                Alan wrote:
                Göran, if the page exists, that would mean there is a message to
                display. No page, no message.
                >
                Yes, but why does the page have to be missing just because there is no
                message? The page could just be an empty page when there is no message.
                >
                The server always returns a page for every request; if the requested
                page doesn't exist, the server returns an error page instead. The fact
                that there is no message doesn't mean that there is something wrong, so
                it doesn't feel right to create an error condition for that.
                >
                Also, to handle a missing page, the client has to distinguish between
                different error pages, to determine if it's just a missing message that
                is causing an error page to be returned, or if it's a real error.
                >
                I'm thinking of having each client check once a minute so the average
                should be 1,000 checks a minute. I have a powerful web server which is
                used very little.
                >
                I suggest that you add a random factor to the delay, so that you don't
                risk to get hundreds of requests at the same time every minute.
                >
                I was thinking for looking for the presence of a
                text file in a network share instead, but I think a web server would
                handle the load better.
                >
                Yes, you would probably get problems with a network share when the
                server is trying to write to the file at the same time as several users
                are trying to read it.
                >
                --
                Göran Andersson
                _____http://www.guffa.com

                Comment

                • Steve Gerrard

                  #9
                  Re: Is &quot;webBrowse r.Navigate&quot ; a good way to continually check if a page exists?

                  Alan wrote:
                  I see your point.
                  >
                  My original idea was that if there was simply no page, then there was
                  nothing to do. If there's always a page, then the client has to
                  download it, read its contents and decide whether to display it or
                  not.
                  >
                  Your idea is probably better because I also need a way to decide if
                  the page has been displayed before. I can do that if I'm already
                  parsing the contents.
                  >
                  And thanks for the random factor, that's a very good idea indeed.
                  >
                  >
                  If you have the resources for it, you could do this very nicely with a web
                  service. The advantage is that you can setup a web service call that returns a
                  few simple values, such as a Boolean indicating MessageAvailabl e, and a DateTime
                  indicating LatestMessage. Your client program can pass values into the web
                  service, then check the return values directly to see if it needs to do
                  something.

                  The service could also return a value indicating how long to wait before asking
                  again, so that it can control the distribution of requests over time. Instead of
                  the client storing values, you could even have the server keep track of which
                  users have seen what, if there is a data store available. The logged on user can
                  be identified by the web service request, and their status could be maintained
                  on the server.

                  Lots of possibilities.. .


                  Comment

                  Working...