Solved

Project help for class.................

Posted on 2006-10-20
8
177 Views
Last Modified: 2010-04-23
I am trying to create a program in vb.net to take data, ie tempratures in farhenheit, and then convert it to celsius. I have it working to convert but having dificulties to get it to connect to the website in the background and gather the temperature data for the conversion. It works fine when we enter the degrees in farenheit manually tho. We would like to enter a zip code and have it gather the temerature data in farenheit and display it in the field we've created that performs the conversion. This project is due soon and I have exhasted all the sources I know of.                                                                                                                                  Any suggestions or ideas will be welcome!!!!!
0
Comment
Question by:MorphinDragon
8 Comments
 
LVL 13

Expert Comment

by:newyuppie
Comment Utility
how do you plan to pull the data from the web? or is that the question?
0
 

Author Comment

by:MorphinDragon
Comment Utility
thats the question my friend
0
 
LVL 17

Accepted Solution

by:
ZeonFlash earned 500 total points
Comment Utility
To connect to the website, I'd use the AxWebBrowser control to load the page, then strip the temperatures from the Document property's HTML body.  You can also use the Document property to get the the form controls.  Something like this:

'Add the following references to your project first:  [COM] Microsoft Internet Controls, [.NET] Microsoft.mshtml

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        AxWebBrowser1.Navigate("http://www.YourTemperaturePage.com")
    End Sub

    Private Sub AxWebBrowser1_NavigateComplete2(ByVal sender As Object, ByVal e As AxSHDocVw.DWebBrowserEvents2_NavigateComplete2Event) Handles AxWebBrowser1.NavigateComplete2
        Dim doc As mshtml.HTMLDocument = AxWebBrowser1.Document
        Dim body As mshtml.IHTMLElement = doc.body

        '"body" now has the HTML code of the page's body, so you can pull the data from it.
    End Sub
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 7

Expert Comment

by:Mohamed Zedan
Comment Utility
or maybe the website offers rss feeds that you could consume and get your data from as extracting data from XML is much more easier and light weight than loading the cumbersome MSHTML.dll library.
0
 

Author Comment

by:MorphinDragon
Comment Utility
I will try these suggestions and let u know what comes about.
0
 
LVL 14

Expert Comment

by:ptakja
Comment Utility
You could also check to see if the web site offers a Web Service that you could subscribe to. If it does, you most likely would  be able to call a function in their service that returns a temps for a given zip or city.
0
 

Author Comment

by:MorphinDragon
Comment Utility
Ok guys, got the program to search a zip code and put the source code onto a txt file (auto saves to the computer). Now we need it to search the txt file for "temp=" and then the, up to, 3 digits after it and then display that in the program itself. Still brainstorming it but could use a few ideas. We actually found another post in here that was similar and used part of the code that was in the comments. I hope all that makes sense. Ideas more than welcome!!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now