954,500 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

sending files over LAN thru C programs

hi,
I am working on a project
and regarding that i want to know how can i send a file to a computer
on the LAN using C / C++ program
PLEASE HELP ME OUT

amitshukla
Newbie Poster
1 post since Nov 2004
Reputation Points: 10
Solved Threads: 0
 

Well i learned this on emonth back in Computer Networks. For this you will need to programs one server and other reciver. the coding of which i give below:: Here i will mention the coding for transmitting a character. If you still need to transmiot a file tell me, i will try to send you the program for it as well.
Server:

#include <stdio.h>
#include <dos.h>
#include<conio.h>

int main(void)
{
   int port = 0;
   char value = 'A';
   char result;

   clrscr();
   outport(port, value);
   printf("Value %c sent to port number %d\n", value, port);
   getch();

   result=inport(port);
   printf("Received value is %c",result);
   getch();

}

Client:

#include <stdio.h>
#include<dos.h>
#include<conio.h>
void main()
{
 char result;
 clrscr();
 outport(0x2fb,0x87);
 outport(0x2f8,0x0c);
 outport(0x2f9,0x00);
 outport(0x2fb,0x07);
 if(inport(0x2fd)!=0x61)
 {
	result=inport(0x2f8);
	printf("your character has been received:%c", result);
 }
 getch();
 }
jigvesh
Light Poster
44 posts since Oct 2004
Reputation Points: 10
Solved Threads: 0
 

Can You Please Tell How Do I Send A Complete File Through The Lan Port??
Thanx
Amna

amnajvd
Newbie Poster
4 posts since Nov 2007
Reputation Points: 8
Solved Threads: 0
 

See your own thread - http://www.daniweb.com/forums/thread97959.html
Thanks for bumping a 3-YEAR old thread with your inane "me too" post.

Salem
Posting Sage
Team Colleague
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You