Solved

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

Posted on 2006-10-20
8
183 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
[X]
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
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

623 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