[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

Visual basic on LAN

Posted on 2008-02-04
5
Medium Priority
?
1,383 Views
Last Modified: 2013-11-25
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
0
Comment
Question by:Max144
  • 2
4 Comments
 
LVL 2

Expert Comment

by:andrewneely
ID: 20822653
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
 

Author Comment

by:Max144
ID: 20822710
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
 
LVL 2

Accepted Solution

by:
andrewneely earned 2000 total points
ID: 20822899
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
 
LVL 1

Expert Comment

by:Computer101
ID: 21288079
Forced accept.

Computer101
EE Admin
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

591 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question