Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

Posted on 2006-10-20
8
180 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
ID: 17778221
how do you plan to pull the data from the web? or is that the question?
0
 

Author Comment

by:MorphinDragon
ID: 17778258
thats the question my friend
0
 
LVL 17

Accepted Solution

by:
ZeonFlash earned 500 total points
ID: 17778671
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
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 7

Expert Comment

by:Mohamed Zedan
ID: 17780965
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
ID: 17782291
I will try these suggestions and let u know what comes about.
0
 
LVL 14

Expert Comment

by:ptakja
ID: 17782384
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
ID: 17824147
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

829 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