Help using system.net.sockets

devilmaster1

Member
Joined
Jul 29, 2007
Messages
16
Programming Experience
5-10
Hey i currently use vb.net 2003 and i am just starting out learning about vb.net sockets here is my problem i can connect to my site and pull its main pages html data but when i try and design a header to direct it to a txt file for parsening it fails to go.
I always get in return a error saying the file is not on the server yet i can browse to that file just fine.
So i was comming here hoping that someone on here may know how to get the system.net.sockets to connect to a site and grab a specific file off the site not just the main file.
if you can that be great.
 
VB.NET:
Dim web As New Net.WebClient
web.DownloadFile("address", "filename")
 
No i wanted to connect to a page off my site for parsening methods dont want it to download just connect.
i know how to use the webrequest but was wondering if you can connect to a site and file and parsen it using system.net.sockets.
 
It is possible, the WebClient is based upon WebRequest, they both use Socket to connect and communicate. But it would be much work to write the WebRequest class again yourself. You can use the WebClient.DownloadData method if you want to handle the response in memory rather than file, or HttpWebRequest if you need to customize the request more.
 
Thank you i will give that a shot do you know of any websites that talk about the sockets outside of connectin to a website i also would like to see how to connect to diff servers messenger servers such as yahoo or msn the webrequest i have read only handles website request so any sites or tutorials that talk about sockets would be also helpful if you can.
 
Back
Top