eCharcha.Com   Support eCharcha.Com. Click on sponsor ad to shop online!

Advertise Here

Go Back   eCharcha.Com > eCharcha Lounge > SoapBox

Notices

SoapBox Speak up, speak on, speak your heart out!

Reply
 
Thread Tools Display Modes
  #1  
Old September 16th, 2002, 12:58 PM
SimpleHuman SimpleHuman is offline
Senior eCharchan
 
Join Date: Dec 2000
Location: Toronto
Posts: 1,200
SimpleHuman will become famous soon enough
Post Help VB gurus!

I have to put WebBrowser control on a form and using the timer event control, I have to bascilly check for an intranet web page status… if for some reason webpage is not available then I have to make a log…

Any ideas how to achieve this using VB6 and standard controls like webbrowser! ??
__________________
Statistics are like a bikini. What they reveal is suggestive, but what they conceal is vital.

---Not Me!
Reply With Quote
  #2  
Old September 16th, 2002, 01:24 PM
GunsNRoses's Avatar
GunsNRoses GunsNRoses is offline
Spear Barbarian
 
Join Date: Jun 2001
Posts: 1,263
GunsNRoses has much to be proud ofGunsNRoses has much to be proud ofGunsNRoses has much to be proud ofGunsNRoses has much to be proud ofGunsNRoses has much to be proud ofGunsNRoses has much to be proud ofGunsNRoses has much to be proud ofGunsNRoses has much to be proud ofGunsNRoses has much to be proud of
This is totally untested code off the top of my head, but it should be more or less correct.

Code:
Dim oFoo as InternetExplorer.Application

Set oFoo = CreateObject("InternetExplorer.Application")
' Navigate to site. Note that the URL is misspelled in code to avoid legal problems! Change it as needed!
oFoo.Navigate2 "www.ya-who.com" 
' Gotta wait while the IE component is working!
While oFoo.Busy
Wend

' Grab the document and then deallocate the IE object when we're done grabbing the document text.
sString = oFoo.Document.Body.InnerHTML

' Deallocate our IE object now
set oFoo=Nothing
Hope this helps
__________________
"Pick up your balls and load up your cannon
For a twenty-one gun salute."
-- For Those About To Rock (We Salute You)

Proud LLKC member since May 2002.
"We've been looking for the enemy for some time now. We've finally found him. We're surrounded. That simplifies things." Lt. Gen. Lewis "Chesty" Puller, USMC, Chosin Reservoir 1950

Reply With Quote
  #3  
Old September 16th, 2002, 01:27 PM
Parashuram's Avatar
Parashuram Parashuram is offline
Vettaikaran
 
Join Date: Aug 2001
Posts: 2,510
Parashuram has much to be proud ofParashuram has much to be proud ofParashuram has much to be proud ofParashuram has much to be proud ofParashuram has much to be proud ofParashuram has much to be proud ofParashuram has much to be proud ofParashuram has much to be proud ofParashuram has much to be proud of
Simple .......Format your Windoze box......Install Solaris on Intel ..........Write a shell script to do a HTTP GET ......put the script in Crontab .......Man MS makes $$$$$ making simple stuff look complicated with Controls and what not
__________________
Once my processor is rented cycles in Korea, my RAM is in orbit, and my storage media is distributed in 10K chunks all over the former Soviet Union, and there is no noticable performance hit. Then I'll have enough bandwidth.

http://www.vinod.us

http://www.storagedimensions.us
Reply With Quote
  #4  
Old September 16th, 2002, 01:29 PM
Big-G's Avatar
Big-G Big-G is offline
Senior eCharchan
 
Join Date: Mar 2001
Posts: 11,580
Big-G has much to be proud ofBig-G has much to be proud ofBig-G has much to be proud ofBig-G has much to be proud ofBig-G has much to be proud ofBig-G has much to be proud ofBig-G has much to be proud ofBig-G has much to be proud ofBig-G has much to be proud of
Why put it in the cron?? You can simply run an infinite process with sleep times in between.
__________________
Having a smoking section in a restaurant is like having a pissing section in a pool!
Reply With Quote
  #5  
Old September 16th, 2002, 01:39 PM
GpeL's Avatar
GpeL GpeL is offline
Pelu Pelu
 
Join Date: Jun 2001
Location: New York/New Jersey
Posts: 16,511
GpeL is a splendid one to beholdGpeL is a splendid one to beholdGpeL is a splendid one to beholdGpeL is a splendid one to beholdGpeL is a splendid one to beholdGpeL is a splendid one to beholdGpeL is a splendid one to behold
I agree biggie.. better yet.. hire a newbie to fire it off for you at $ prompt at regular intervals.. That way you will also be giving employment to an otherwise useless bum.
__________________
GpeL a day
Keeps mischief away.
Reply With Quote
  #6  
Old September 16th, 2002, 01:39 PM
SimpleHuman SimpleHuman is offline
Senior eCharchan
 
Join Date: Dec 2000
Location: Toronto
Posts: 1,200
SimpleHuman will become famous soon enough
Guns bro,

Actully we have our intranet site, the purpose of this tool is to check if it is up and running or not! Lets say after each hour I have to check if the intranet site is available or not!!!

parsu bhai kis zamane ki baat kar rahe ho .NET framework is on the way for unix
__________________
Statistics are like a bikini. What they reveal is suggestive, but what they conceal is vital.

---Not Me!
Reply With Quote
  #7  
Old September 17th, 2002, 05:53 AM
GunsNRoses's Avatar
GunsNRoses GunsNRoses is offline
Spear Barbarian
 
Join Date: Jun 2001
Posts: 1,263
GunsNRoses has much to be proud ofGunsNRoses has much to be proud ofGunsNRoses has much to be proud ofGunsNRoses has much to be proud ofGunsNRoses has much to be proud ofGunsNRoses has much to be proud ofGunsNRoses has much to be proud ofGunsNRoses has much to be proud ofGunsNRoses has much to be proud of
SimpleHuman sir, that's why I posted the above code. You can use it to hit a specific page on your intranet site and check if the sString contains the expected message or not. If the expected message is not received, then you can add a little more code to e-mail the necessary people.

Then all you have to do is schedule the program to run every hour or so. If you're running this program on a Windows NT, Win2K or WinXP machine, you can do this by using the Scheduler from the control panel. If you want to be macho about it and use the command line, all you have to do is research the AT command (type help at at the command prompt).

If you're using a *NIX system, you might as well save some time and install Big Brother, which is (a) free for non-commercial use, (b) features a webpage that you can hit to query the health of all your servers and (c) works pretty well!

As for running tasks on an infinite loop vs. running tasks from a crontab, I prefer the crontab method personally. Reason: I've had too many sysadmins get mad at me for leaving perl scripts running after I've logged off. It's all ok if you're running your own servers, but sysadmins generally tend to take a dim view of processes running for infinite time and usually kill such processes.
__________________
"Pick up your balls and load up your cannon
For a twenty-one gun salute."
-- For Those About To Rock (We Salute You)

Proud LLKC member since May 2002.
"We've been looking for the enemy for some time now. We've finally found him. We're surrounded. That simplifies things." Lt. Gen. Lewis "Chesty" Puller, USMC, Chosin Reservoir 1950


Last edited by GunsNRoses; September 17th, 2002 at 05:58 AM.
Reply With Quote
  #8  
Old September 17th, 2002, 05:57 AM
SimpleHuman SimpleHuman is offline
Senior eCharchan
 
Join Date: Dec 2000
Location: Toronto
Posts: 1,200
SimpleHuman will become famous soon enough
Guns bro,

I did try to use your code, but even if i pass wrong non existing site, the sstirng gives me value in retrun... so its kind of tuff to make a judgement about if the site is active or not???

Any other option??? anything in Java???
__________________
Statistics are like a bikini. What they reveal is suggestive, but what they conceal is vital.

---Not Me!
Reply With Quote
  #9  
Old September 17th, 2002, 06:05 AM
GunsNRoses's Avatar
GunsNRoses GunsNRoses is offline
Spear Barbarian
 
Join Date: Jun 2001
Posts: 1,263
GunsNRoses has much to be proud ofGunsNRoses has much to be proud ofGunsNRoses has much to be proud ofGunsNRoses has much to be proud ofGunsNRoses has much to be proud ofGunsNRoses has much to be proud ofGunsNRoses has much to be proud ofGunsNRoses has much to be proud ofGunsNRoses has much to be proud of
SimpleHuman Sir, I didn't say sString would not be populated. In fact, if you hit a non-existent website, it'll contain the HTML code that effectively says "Site not found". What you need to do is get the code to retrieve a known page on your intranet (even something that prints something simple as "I'm ok" will do). Then you can compare sString against that known text. If the message in sString is not the same as what you were expecting, then you can get the program to start e-mailing people.

[edit]
BTW the first declaration should be:

Dim oFoo As InternetExplorer

Also don't forget to add Microsoft Internet Explorer to your project references (Menu: Project ---> References)
[/edit]
__________________
"Pick up your balls and load up your cannon
For a twenty-one gun salute."
-- For Those About To Rock (We Salute You)

Proud LLKC member since May 2002.
"We've been looking for the enemy for some time now. We've finally found him. We're surrounded. That simplifies things." Lt. Gen. Lewis "Chesty" Puller, USMC, Chosin Reservoir 1950


Last edited by GunsNRoses; September 17th, 2002 at 06:08 AM.
Reply With Quote
  #10  
Old September 17th, 2002, 06:13 AM
SimpleHuman SimpleHuman is offline
Senior eCharchan
 
Join Date: Dec 2000
Location: Toronto
Posts: 1,200
SimpleHuman will become famous soon enough
oke let me try! about email, do i have to use any third party control?
__________________
Statistics are like a bikini. What they reveal is suggestive, but what they conceal is vital.

---Not Me!
Reply With Quote
  #11  
Old September 17th, 2002, 06:20 AM
nayasavera
Guest
 
Posts: n/a
Quote:
Originally posted by SimpleHuman

anything in Java???
check the class java.net.HttpURLConnection..

the method of ur interest is here:
http://java.sun.com/products/jdk/1.2...etResponseCode()

u will have to schedule the ping in any case
Reply With Quote
  #12  
Old September 17th, 2002, 06:24 AM
GunsNRoses's Avatar
GunsNRoses GunsNRoses is offline
Spear Barbarian
 
Join Date: Jun 2001
Posts: 1,263
GunsNRoses has much to be proud ofGunsNRoses has much to be proud ofGunsNRoses has much to be proud ofGunsNRoses has much to be proud ofGunsNRoses has much to be proud ofGunsNRoses has much to be proud ofGunsNRoses has much to be proud ofGunsNRoses has much to be proud ofGunsNRoses has much to be proud of
You can use the CDONTS control, if you have it installed (it comes along with IIS and a couple of other Micro$oft products). You can search google for "CDONTS install" for more info. You may also be able to control Microsoft Outlook from VB to send your messages. If not, there are several third party Active-X controls. Also, you can write your own version in Visual C++, if you're inclined to hack your own control. Personally, I use Delphi or C++ Builder most of the time for Windows Development and they already come with a native Mail control (and there are also several third party controls available for free ).
__________________
"Pick up your balls and load up your cannon
For a twenty-one gun salute."
-- For Those About To Rock (We Salute You)

Proud LLKC member since May 2002.
"We've been looking for the enemy for some time now. We've finally found him. We're surrounded. That simplifies things." Lt. Gen. Lewis "Chesty" Puller, USMC, Chosin Reservoir 1950

Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Any C++ gurus dirty Computing 1 August 27th, 2007 06:35 PM
Calling all *nix Gurus style bhai Computing 11 October 21st, 2006 09:20 AM
ShoutOut to the C++ Gurus JaiSpeaks Computing 1 March 9th, 2005 12:37 PM
Linux Gurus, Pls Help me.. viruss Computing 3 October 6th, 2004 11:27 PM
LoadRunner help - QA gurus please help echarcha SoapBox 2 October 25th, 2002 09:41 AM


All times are GMT -7. The time now is 12:50 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Site Copyright © eCharcha.Com 2000-2012.