Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
Cpp1.cpp
Package: Desktop.rar [view]
Upload User: hnwbjx
Upload Date: 2022-07-21
Package Size: 497k
Code Size: 1k
Category:
ERP-EIP-OA-Portal
Development Platform:
Visual C++
- #include <iostream.h>
- #include <fstream.h>
- #include <stdlib.h>
- #include <string.h>
- struct txrec
- { char no[6];
- char name[20];
- char tel[9];
- char postc[7];
- char addr[30];
- };
- void main()
- { struct txrec gzrec; int i;
- char filename[20], num[5];
- fstream infile;
- cout << "请输入通讯录文件名:";
- cin >> filename ;
- infile.open( filename, ios::in|ios::binary );
- if ( !infile )
- { cerr << "文件不能打开!" << endl;
- abort(); }
- infile.seekg( 0,ios::end );
- long posend = infile.tellp();
- infile.seekg( 0,ios::beg );
- cout << "请输入职工编号:" ;
- cin >> num;
- do
- { infile.read(( char * )&gzrec,sizeof( txrec ));
- } while ( strcmp( gzrec.no,num ) !=0 && infile.tellp() != posend );
- if ( strcmp( gzrec.no,num ) == 0 )
- { cout << "该职工的记录找到了!" << endl;
- cout << "编号:" << gzrec.no << endl;
- cout << "姓名:"<< gzrec.name << endl;
- cout << "电话号码:"<< gzrec.tel << endl;
- cout << "邮政编码:" << gzrec.postc << endl;
- cout << "通信地址:" << gzrec.addr << endl;
- }
- else
- { cout << "该职工的记录找不到!" << endl; }
- infile.close();
- }