Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending data over a local area network

Status
Not open for further replies.

Stopher

Programmer
Jan 12, 2002
29
US
I want to send some data to another computer. Just a few variables, not any large amount of data. Does anyone have any idea how/if I could do this?

Thanx,
Stopher
 
Hi,
If you have permission to do so, you can just create a flat file on the other computer. Like so:

Open &quot;\\<computername>\<sharename>\<filename.ext>&quot; for output as #1

This syntax is referred to as UNC (Universal Naming Convention)

Good Luck,
Paul
 
Nah Sir!

That means constantly checking to see if the file has been updated, or indeed exists...

What you really want to do is have a look at a thing called the Winsock control... That is used for passing info between PCs - I once wrote an app for transferring the content a text box on One PC to a textbox on another - and that worked with Winsock...
 
If I were to use the file method, is there any way of determining the computername and sharename of the other computer?

Stopher
 
Yes, but as a professional I really would encourage you not to use the file method... For one thing constantly pinging the hard drive every half second is a bit pointless...

If you use WinSock, you'll get a nice little event to latch onto one a computer tries to send info to you... And I think it stores the hostname that sent the info as a property too!

But, if you'll insist on using files, read about the Windows32 API. There's bound to be a function in their for finding the name of the computer you are on - so have the sending machine build it's name into the text file...

Hope that helped you out...


Martin
 
I'm thinking of using the Winsock method. Does it come with Visual Studio Enterprise edition or will I have to get it somewhere?

Stopher
 
You should already have the Winsock Control if you have VS Ent 6...

Press Cntrl-T while in your VB project, and look down the Controls tab for &quot;Microsoft Winsock Control 6.0&quot;

Have a look in the MSDN for details on it's use...

Martin.
 
Thanx alot!!! That worked perfectly!

Stopher
 
When i run my s/w i want to inform the other computers on the n/w of my ip add. How can I do this without knowing the ip adds of the other comps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top