homebrew311 Posted February 24, 2004 Posted February 24, 2004 Hey guys, I am just wondering how I would be able to connect to a server, get some info, and disconnect. If you've ever seen those 'Weather Bug' programs that get the temperature every 5 minutes or so, then that is a great example of what I want to do. Another example is how SpyBot Search and Destroy checks to see if there are updates available, and if so, download them. Does andybody know how the do this in VB.net? Quote
*Experts* Bucky Posted February 24, 2004 *Experts* Posted February 24, 2004 Are you connecting to some server that already exits, or are you writing both the server and client applications? If you're writing them yourself, I'd highly reccomend creating an XML Web Service that hands out data. It's very easy to implement these services in ASP.NET and Windows applications. If you're trying to access data that's already in some other form, then you're going to have to manually download it (with Sockets or a WebClient) and parse the data out of the string. Quote "Being grown up isn't half as fun as growing up These are the best days of our lives" -The Ataris, In This Diary
homebrew311 Posted February 25, 2004 Author Posted February 25, 2004 Thanks, but I'm still a newbie at VB and I don't know how to do all those web services and such. Think of it this way, I give some of my programs to my friends. Lets say that I coded an "update" feature into a program I wrote. How would I have the program connect to my computer and have the host on my computer distribute the download? (I'm too young to get fixed IP domains and servers and stuff) Quote
*Experts* Bucky Posted February 25, 2004 *Experts* Posted February 25, 2004 This is a fairly complex thing to pull together, but it can be done. You will need a good understanding of how the Sockets namespace works (and there are plenty of examples in the SDK documentation). Then it's just a matter of using a TcpClient or some other Socket to connect to your computer (assuming you have an IP that's relatively static) and have a host app running on your computer to accept the connection and send the update by converting it into an array of bytes and sending it along in small chunks. The update itself could be in the form of a DLL of functions that your program references, and it copied over when the program is not running. Or you might choose to update the entire exe. Either way, I will point out that you will need to close the main application and have another app to update the main app. Quote "Being grown up isn't half as fun as growing up These are the best days of our lives" -The Ataris, In This Diary
homebrew311 Posted February 25, 2004 Author Posted February 25, 2004 What should I enter in as the port? Sorry, I don't really have any knowledge of server stuff. Quote
Jay1b Posted February 26, 2004 Posted February 26, 2004 Technically your port could be anything from around 1 to 1048ish. As for the static IP address sign up to dynu.com, they do a basic version for free and it will solve any problems with a variable IP address. Quote
homebrew311 Posted February 26, 2004 Author Posted February 26, 2004 How do I send packets back and forth? Quote
Jay1b Posted February 26, 2004 Posted February 26, 2004 (edited) You may be better off, learning .NET better before you try this. As this is a very big project Edited February 26, 2004 by Jay1b Quote
m7j4p7 Posted February 26, 2004 Posted February 26, 2004 If you want to connect to a NT/W2K/W2K3 server and get user/domain information. Look up LDAP. ;) Quote :) Mike :) He who has a secret, must keep it secret he has a secret to keep......
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.