Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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?

  • *Experts*
Posted

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.

"Being grown up isn't half as fun as growing up

These are the best days of our lives"

-The Ataris, In This Diary

Posted
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)
  • *Experts*
Posted

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.

"Being grown up isn't half as fun as growing up

These are the best days of our lives"

-The Ataris, In This Diary

Posted

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.

Posted
If you want to connect to a NT/W2K/W2K3 server and get user/domain information. Look up LDAP. ;)

:) Mike :)

 

He who has a secret, must keep it secret he has a secret to keep......

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...