473,327 Members | 1,892 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

vb.net windows application that connects to the net.

Hello,

I am completely new to the windows platform and the .net technologies.
I have to pick up vb.net on a real fast track to develop industry code.
For my own learning purposes, I am writing a small application -

A typical windows application in vb.net which

contains a form with a button. When the button is clicked the
application -

1. must connect to a series of websites, and extract certain
information from the webpages and present it in textual format on the
form in the windows application.

2. must log in to my yahoo and gmail accounts, do nothing and log out.

Typically, I am not worried about the usre interface aspect of the
application but more about the 'Connectivity' techniques.

If someone could guide me in the right direction, it would help me get
onto a rapid start :-)

Thanks,
Labrynth !

Feb 10 '06 #1
2 981
I don't know if this code is very efficient, but here's a solution that has
worked for me...
---------------------------------------------------------------------
Dim PageAddress As String = "http://www.mysite.com

'Send a request to the site.
Dim myRequest As HttpWebRequest = CType(WebRequest.Create(PageAddress),
HttpWebRequest)

'Get a response from the site.
Dim myResponse As HttpWebResponse = CType(myRequest.GetResponse(),
HttpWebResponse)

'Get the data in stream format
Dim PageStream As Stream = myResponse.GetResponseStream()
Dim srPage As New StreamReader(PageStream, Encoding.UTF8)

'Read the contents using a buffer, or all at once, your preference.
Dim Contents As String = srPage.ReadToEnd()

'Extract information from the contents
MyMethod(Contents)

'Clean up
myResponse.Close()
srPage.Close()

---------------------------------------------------------------------

As far as logging into Yahoo! and Gmail accounts is concerned, that would
require authentication with a username and password. And I'm not sure how to
implement that. (If it is possible, since their servers would check for the
client)

Regards,

Cerebrus.
Feb 10 '06 #2
Thanks! I lifted off the code u gave..it worked.. I did implement a
different version later on.. using the WebClient class, though the one
that you presented here seems to be a better way !

Feb 11 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: VIvek Thakur | last post by:
Hell I m making a C# windows application which connects to excel to retrieve live data( stock quotes which are feeded to this excel sheet from other program via internet). The data in excel sheet...
0
by: Andrew Dowding | last post by:
Hi Everybody, I have been looking at problems with my Windows Forms C# application and it's little Jet 4 (Access) database for the last few days. The Windows Forms app implements a facade and...
5
by: vinoth | last post by:
Hi, I have created WindowsService Project.In that Project OnStart Method i have written the following Code. In this code the Server is waiting for the connection from client. When the Client...
0
by: Mark | last post by:
We have an IIS 6 web server on W2003 Server that connects to a SQL Server 2K (Sp3) running on W2003 Server. It connects using Delegation. Delegation is enabled in Active Directory. The two...
4
by: Matt | last post by:
The ASP.NET application connects to MS-SQL database, and I already disabled Anonymous access in IIS, and add ASPNET user in it. When I run the application, it throws the following error on windows...
8
by: Mark Rowland | last post by:
Please bear with me, as I am a newbie in the world of databases and DB2. We are trying to migrate an application that binds to a DB2 database (Workgroup Edition, V6.1) from a server running Windows...
4
by: dm1608 | last post by:
Hi -- I have a VB6 application that I plan on rewriting in C#.NET. The program today basically connects to a SQL Server and parses varies system stats from our mainframes and rolls the data up...
0
by: Taduri | last post by:
Hi, I am creating a windows service that will process exe file( Developed in VB and connects to database using DSN and sa/master login). When service process exe I am getting Database (Sql Server...
0
balabaster
by: balabaster | last post by:
Hi, I know this question has been answered before (somewhat) but I have a twist... I've written a client/server application where the server portion runs as a windows service and allows...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.