Visual basic on LAN

I have two computers connected with a LAN and I want to write a file to a computer hard disk to another computer hard disk using Visual Basic code. What is the exact command to do it.
thanks
Max144Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

andrewneelyCommented:
VB 1.0?  Is this the DOS program?

Anyway, there are several approaches to doing this.  The first two that come to mind are listed below.  I can help you with the first method, but the second is rather difficult.

The easiest way is to go to the computer whose drive you wish to write to and share the folder you want to write to.  On the computer with the program, just open the file and write.  The path will be \\computername\foldername\filename.extension

Another way to do this is to have two programs, one on each computer, and write up some software to communicate over the LAP via TCP.  This is not easy, and is more prone to faliure.
0
Max144Author Commented:
I already made the Lan connection. I want to know how make the connection and write file on the hard disk with the code of Visual Basic 6.
Thanks
0
andrewneelyCommented:
vb classic code
Open "\\computerName\foldername\myfile.txt" for output as #1
print #1, "I'm writting this out to a file on another computer"
close #1
vb net code
dim myStream as new io.streamwriter("\\computername\foldername\myfile.txt")
myStream.writeline ("I'm writting this out to a file on another computer"
")
mystream.close


OR if you've mapped the folder as a drive, just open it up like it was a physical drive.

Open "z:\foldername\myfile.txt" for output as #1
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Computer101Commented:
Forced accept.

Computer101
EE Admin
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.