|
From: Dondolo M. <MDo...@OL...> - 2003-07-01 14:45:42
|
I managed to find a solution.
I create a shotcut and point it to my pc eg....(
\\myipaddress\myfolderWithDatabase\readapplication.exe
<file://\\myipaddress\myfolderWithDatabase\readapplication.exe> )
I then only send the shortcut to them.
Thanks anyway
-----Original Message-----
From: Dondolo Mpho [mailto:MDo...@OL...]
Sent: 01 July 2003 10:09 AM
To: dev...@li...
Subject: [Dev-C++] WriteToReadFrom
Hi all,
I recently developed a database with all my collegues contact details. I
wrote 2 applications
1) to writer data to file
2) to read data from file
//File writer
ofstream create("mpho");
create<<"Name : Mpho Dondolo\n"
<<"Team : Service Hub\n"
<<"Title : Support Analyst\n"
<<"Group: CSC.CTN.POPS.CLIENTSERVICES\n"
<<"Ext : 30059\n"
<<"Cell : 2784 317 0045\n";
create.close();
//end of file write
//file reader
cout<<"Enter name only :";
cin>>name1;
system("cls");
#include "limpho.h"
ifstream read(name);
if(!read) //if file does not exist
{
cerr<<"\t\t--------------------------------------\n"
<<"\t\t**NAME ERROR:THE NAME DOES NOT EXIST**\n"
<<"\t\t--------------------------------------\n"
<<"\t\tEither, you have spelt the name incorrectly,
\n"
<<"\t\tor the name is not yet on the Name Tel\n"
<<"\t\tdatabase. To have a name added to Name Tel,
Please\n"
<<"\t\temail me, with the details, at
<mailto:mdo...@cs...> mdo...@cs...";
}
cin.ignore(1,'\n'); //eat away the newline command
char ch;
while(read.get(ch))
cout<<ch;
read.close();
The help that I need.
I realised that if my xt, for example was to change, then I would have to
re-send the entire write file application to everybody I sent the program
to.
I only want to send them the interface(file reader) and store the database
on my pc. I have about 200 names on the database.
how can I get the reader to read from the database(on my pc) by just typing
in the search criteria (in my case, the name).
I know that I can achieve this by getting the user to type, for example
\\MyIpAddress\The Folder\name, where the file name would be
ofstream create( \\MyIpAddress\The <file://\\MyIpAddress\The Folder\name>
Folder\name);
Please help
Mpho Dondolo
Support Analyst
CSC Computer Sciences (South Africa) (Pty) Ltd
Tel: +27 21 5030059
Fax: +27 21 5095619
Email:MDo...@ol...
Email: MDo...@cs...
|