通讯录获取源码完整版(最新获取通讯录源码)
本文目录一览:
- 1、有哪位大神有iphone通讯录源码?用UI做的
- 2、C++通讯录的源代码
- 3、跪求大神给份用Android做的手机通讯录的完整源码,能够打电话,发短信,创建等等,谢谢了。
- 4、怎么使用Asp做通讯录的源码
- 5、C程序通讯录源代码 要简单点 不要太复杂
有哪位大神有iphone通讯录源码?用UI做的
建议可以通过第三方软件微信来完成,具体方法如下:
1、在原来的手机上下载微信,安装并登录。
2、点击微信里的设置,选择通用,点击功能,再点击通讯录安全助手,选择启用,之后点击备份即可上传手机的通讯录。
3、在ipad上同样下载一个微信,登陆后照以上方法找到通讯录安全助手,进入后点击恢复即可下载并导入通讯录。
C++通讯录的源代码
#includeiostream
#includestring
#includeiomanip
#includelist
#includefstream
#includealgorithm
#define SPACE "\t\t\t"
using namespace std;
struct Record{
string name;
string tel;
public:
friend ostream operator(ostream os,const Record *rec){
return osrec-nameSPACErec-telendl;
};
friend istream operator(istream is,Record *rec){
isrec-name;
isrec-tel;
return is;
}
static bool comp(string patten,int type,Record *rec){
switch(type){
case 0: {return rec-name==patten;}break;
case 1: {return rec-tel==patten;}break;
}
return false;
}
static bool isvan(Record *rec){
return (rec-name==""rec-tel=="");
}
};
class RecordList:public listRecord*
{
public:
friend ostream operator(ostream os,const RecordList c_rl){
RecordList::const_iterator it=c_rl.begin();
while(it!=c_rl.end()){
os*it;
it++;
}
return os;
}
friend istream operator(istream is,RecordList rl){
RecordList::const_iterator it;
while(!is.eof()){
Record *prec=new Record;
isprec;
if(Record::isvan(prec)) continue;
rl.listRecord*::push_back(prec);
}
return is;
}
void clear();
iterator erase(iterator pos);
~RecordList(){
this-clear();
}
};
void RecordList::clear(){
RecordList::const_iterator it=this-begin();
while(it!=this-end()){
delete(*it);
it++;
}
this-listRecord*::clear();
}
RecordList::iterator RecordList::erase(iterator pos){
delete(*pos);
return listRecord*::erase(pos);
}
class AddressList{
protected:
RecordList recList;
public:
typedef RecordList::iterator Iterator;
//从通信录中寻找一个记录
virtual Iterator findRecord(string patten,int type,Iterator from);
virtual void addRecord(Record* rec);
virtual void removeRecord(Iterator it);
virtual void editRecord(Record* rec,Iterator it);
virtual void saveRecords(ostream os);
virtual void loadRecords(istream is);
virtual void addRecords(istream is);
virtual ~AddressList();
const int size() const{return (int)recList.size();}
const void clear(){recList.clear();}
Iterator begin(){return recList.begin();}
Iterator end() {return recList.end();}
};
AddressList::Iterator AddressList::findRecord(string patten,int type,Iterator from){
Iterator it;
it=from;
while(it!=recList.end()){
if(Record::comp(patten,type,*it)){
return it;
}
it++;
}
return it;
}
void AddressList::addRecord(Record* rec){
recList.push_back(rec);
}
void AddressList::removeRecord(Iterator it){
recList.erase(it);
}
void AddressList::editRecord(Record* rec,Iterator it){
delete(*it);
*it=rec;
}
void AddressList::saveRecords(ostream os){
osrecList;
}
void AddressList::loadRecords(istream is){
isrecList;
}
void AddressList::addRecords(istream is){
}
AddressList::~AddressList(){
recList.clear();
}
class AddressBook : public AddressList{
protected:
bool isModified;//通信录是否已被修改还未保存
public:
AddressBook();
virtual ~AddressBook();
//开始通信录的用户界面操作
virtual void start();
//菜单处理函数管理程序的用户界面操作
virtual void handleMenu();
//显示记录
virtual void displayRecords();
//查询记录
virtual void queryRecord();
//添加记录
virtual void addRecord();
//保存记录
virtual void saveRecords();
//读取记录
virtual void loadRecords();
//结束程序
virtual void quit();
//清空当前记录信息
virtual void clear();
protected:
//菜单选择函数
char menuSelect();
//显示表头
void dispTable();
};
AddressBook::AddressBook(){
}
AddressBook::~AddressBook(){;}
char AddressBook::menuSelect(){
char a=0;
cina;
if(a=='y'||a=='Y'){a='1';}
if(a=='n'||a=='N'){a='2';}
return a;
}
void AddressBook::start(){
cout "\n\t***** 欢迎使用sjb版通讯录 *****";
handleMenu();
}
void AddressBook::handleMenu(){
cout "\n\n\t\t\t-- 菜单管理 --\n\n";
cout "\tA -- 添加人员纪录 (Add Record)\n"
"\tF -- 查询纪录 (Find Record)\n"
"\tD -- 显示纪录 (Display Records)\n"
"\tL -- 从文本或标准输入流中加载纪录 (Load Records)\n"
"\tC -- 清空当前记录信息\n"
"\tS -- 保存记录 (Save Records)\n"
"\tQ -- 结束程序 (QUIT)\n";
switch(menuSelect()){
case 'A':
case 'a':addRecord();break;
case 'F':
case 'f':queryRecord();break;
case 'D':
case 'd':displayRecords();break;
case 'L':
case 'l':loadRecords();break;
case 'C':
case 'c':clear();break;
case 'S':
case 's':saveRecords();break;
case 'Q':
case 'q':quit();break;
}
handleMenu();
}
void AddressBook::displayRecords(){
cout"姓名"SPACE"电话"endl;
AddressList::saveRecords(cout);
cout"一共找到"size()"个对象。"endl;
cout"1"SPACE"返回"endl;
cout"2"SPACE"修改"endl;
cout"3"SPACE"删除"endl;
switch(menuSelect()){
case '1':break;
case '2':{
if(!size()){
cout"记录为0,无法修改。"endl;
break;
}
cout"要修改第几个?""1~"size()endl;
int i;
cini;
if(i1||isize()){
break;
}
Record *prec=new Record;
cout"姓名:"'\n'"电话:"'\n';
cinprec;
Iterator it=recList.begin();
while(i!=1){
it++;
i--;
}
editRecord(prec,it);
}break;
case'3':{
if(!size()){
cout"记录为0,无法修改。"endl;
break;
}
cout"要删除第几个?""1~"size()endl;
int i;
cini;
if(i1||isize()){
break;
}
Iterator it=recList.begin();
while(i!=1){
it++;
i--;
}
removeRecord(it);
}break;
}
}
void AddressBook::addRecord(){
string name,tel;
cout "\n输入名字: ";
cin name;
cout "输入电话: ";
cin tel;
Record* temp=new Record;
temp-name=name;
temp-tel=tel;
AddressList::addRecord(temp);
cout"是否继续(Y/N)"endl;
switch(menuSelect()){
case '1':addRecord();break;
case '2':break;
}
}
void AddressBook::queryRecord(){
cout"1"SPACE"按姓名查找"endl;
cout"2"SPACE"按电话查找"endl;
int type=-1;
string patten;
switch(menuSelect()){
case '1':{
type=0;
cout"请输入姓名"endl;
cinpatten;
}break;
case '2':{
type=1;
cout"请输入电话号码"endl;
cinpatten;
}break;
}
Iterator it=begin();
listIterator li;
cout"姓名"SPACE"电话"endl;
while((it=findRecord(patten,type,it))!=end()){
cout*it;
li.push_back(it);
it++;
}
cout"一共找到"li.size()"个对象。"endl;
cout"1"SPACE"返回"endl;
cout"2"SPACE"修改"endl;
cout"3"SPACE"删除"endl;
switch(menuSelect()){
case'1':break;
case'2':{
if(!li.size()){
cout"记录为0,无法修改。"endl;
break;
}
cout"要修改第几个?""1~"li.size()endl;
int i;
cini;
Record *prec=new Record;
cout"姓名:"'\n'"电话:"'\n';
cinprec;
listIterator::const_iterator it=li.begin();
while(i!=1){
it++;
i--;
}
editRecord(prec,*it);
}break;
case'3':{
if(!li.size()){
cout"记录为0,无法修改。"endl;
break;
}
cout"要删除第几个?""1~"li.size()endl;
int i;
cini;
listIterator::const_iterator it=li.begin();
while(i!=1){
it++;
i--;
}
removeRecord(*it);
}break;
}
}
void AddressBook::saveRecords(){
cout"1"SPACE"使用默认文件名。"endl;
cout"2"SPACE"使用自定义文件名。"endl;
cout"3"SPACE"返回"endl;
switch(menuSelect()){
case '1':{
ofstream file("default",ios::app);
AddressList::saveRecords(file);
file.close();
}break;
case '2':{
cout"请输入您定义的文件名:"endl;
string fname;
cinfname;
ofstream file(fname.c_str(),ios::app);
AddressList::saveRecords(file);
file.close();
}break;
case '3':break;
}
}
void AddressBook::loadRecords(){
cout"1"SPACE"使用默认文件。"endl;
cout"2"SPACE"使用自定义文件。"endl;
cout"3"SPACE"返回"endl;
switch(menuSelect()){
case '1':{
cout"1"SPACE"覆盖当前内容"endl;
cout"2"SPACE"追加到当前文件"endl;
switch(menuSelect()){
case '1':
AddressList::clear();break;
case '2':break;
}
ifstream file("default");
AddressList::loadRecords(file);
file.close();
}break;
case '2':{
cout"请输入文件名:"endl;
string fname;
cinfname;
ifstream file(fname.c_str());
AddressList::loadRecords(file);
file.close();
}break;
case '3':break;
}
}
void AddressBook::clear(){
cout"是否要清除内存中所有内容?(Y/N)"endl;
switch(menuSelect()){
case '1':AddressList::clear();break;
case '2':break;
}
}
void AddressBook::quit(){
cout"是否要保存文件?(Y/N)"endl;
switch(menuSelect()){
case'1':saveRecords();break;
case'2':break;
}
exit(0);
}
int main(int argc, char *argv[])
{
AddressBook a;
a.start();
system("PAUSE");
return EXIT_SUCCESS;
}
跪求大神给份用Android做的手机通讯录的完整源码,能够打电话,发短信,创建等等,谢谢了。
Android通讯录管理(获取联系人、通话记录、短信消息)
用这个地址
怎么使用Asp做通讯录的源码
要看你做什么通讯录了。最好是去网上下载中文的对照拼音数据库。然后录入的时候将姓名对应的拼音也存进去。
如果只是存储然后查询就很简单了。弄个ACCESS就行了。然后左边或者上面有A-Z字母可以点击跳到相应的记录。
C程序通讯录源代码 要简单点 不要太复杂
#include stdio.h//通讯录
#include conio.h
#include string.h
#include stdlib.h
#define N 100
int M=5;
struct student
{ char num[10];char name[10];char tel[10];};
void myprint()
{
system("cls");
printf(" |-----------------------------------------------|\n");
printf(" | :-)请输入选项编号(0-7): |\n");
printf(" |-----------------------------------------------|\n");
printf(" |--------------1--创建通讯录--------------------|\n");
printf(" |--------------2--显示通讯录--------------------|\n");
printf(" |--------------3--查询通讯录--------------------|\n");
printf(" |--------------4--修改通讯录--------------------|\n");
printf(" |--------------5--添加通讯录--------------------|\n");
printf(" |--------------6--删除通讯录--------------------|\n");
printf(" |--------------7--排序通讯录--------------------|\n");
printf(" |--------------0--退出--------------------------|\n");
printf(" |-----------------------------------------------|\n");
}
void mycreat(struct student *p,int n)
{
struct student *q=p;
FILE *fp=NULL;
fp=fopen("d:\\jilu.dat","w");
if(fp==NULL){printf("error"); return;}
for(p=q;p-qn;p++)
{
printf("\n");
printf("第%d条记录:\n",p-q+1);
printf("学号:");
do
{gets(p-num);}
while(strcmp(p-num,"")==0);
printf("姓名:");
gets(p-name);
printf("电话:");
gets(p-tel);
fprintf(fp,"%23s%15s%15s\n",p-num,p-name,p-tel);
}
}
void mydisplay(struct student *p,int n)
{
FILE *fp=NULL;
fp=fopen("d:\\jilu.dat","r");
if(fp==NULL){printf("error"); return;}
system("cls");
printf(" 学号 姓名 电话\n");
while(n0)
{
fscanf(fp,"%23s%15s%15s",p-num,p-name,p-tel);
printf("%23s%15s%15s\n",p-num,p-name,p-tel);
p++;n--;
}
}
void mysearch(struct student *p,int n)
{
struct student *q=p;
int flag=0;
char c='\0',nm[10]="",nam[10]="";
printf("\n按照学号查询(h)或姓名查询(m):\n");
c=getche();
if(c=='h'||c=='H')
{
printf("请输入要查询记录的学号:");gets(nm);
for(p=q;p-qn;p++)
if(strcmp(nm,p-num)==0)
{
printf(" 学号 姓名 电话\n");
printf("%23s%15s%15s\n",p-num,p-name,p-tel);
flag=1;
}
if(flag==0) printf("wrong...\n");
}
else if(c=='m'||c=='M')
{
printf("请输入要查询记录的姓名:");gets(nam);
for(p=q;p-qn;p++)
if(strcmp(nam,p-name)==0)
{
printf(" 学号 姓名 电话\n");
printf("%23s%15s%15s\n",p-num,p-name,p-tel);
flag=1;
}
if(flag==0) printf("wrong...\n");
}
else printf("wrong...\n");
}
void mymodify(struct student *p,int n)
{
struct student *q=p;
FILE *fp=NULL;
char nam[10]="";
mydisplay(p,n);
printf("请输入您想要修改记录的姓名:\n");gets(nam);
for(p=q;p-qn;p++)
if(strcmp(nam,p-name)==0) break;
if(p-q==n)
printf("wrong...");
else
{
printf("请输入正确的学号:");
do
gets(p-num);
while(strcmp(p-num,"")==0);
printf("请输入正确的姓名:");
gets(p-name);
printf("请输入正确的电话:");
gets(p-tel);
}
fp=fopen("d:\\jilu.dat","w");
if(fp==NULL){printf("error"); exit(0);}
for(p=q;p-qn;p++)
fprintf(fp,"%23s%15s%15s\n",p-num,p-name,p-tel);
fclose(fp);
}
void myadd(struct student *p,int n)
{
FILE *fp=NULL;
struct student *q=p;
char c='\n',tempnum[10]="",tempname[10]="",temptel[10]="";
printf("\n");
while(strcmp(p-num,"")!=0)
{
printf("%23s%15s%15s\n",p-num,p-name,p-tel);
p++;
}
n=p-q;
do
{
printf("请输入新纪录的学号:");
do
gets(tempnum);
while(strcmp(tempnum,"")==0);
printf("请输入新纪录的姓名:");
gets(tempname);
printf("请输入新纪录的电话:");
gets(temptel);
for(p=q;p-qn;p++)
if(strcmp(tempnum,p-num)==0||strcmp(temptel,p-tel)==0)
{
printf("学号或电话号码需要重新输入吗(Y/N)?");
c=getche();
putchar('\n');
break;
}
if(p-q==n)
{
strcpy(p-num,tempnum);
strcpy(p-name,tempname);
strcpy(p-tel,temptel);
break;
}
}while(c=='y'||c=='Y');
fp=fopen("d:\\jilu.dat","w");
if(fp==NULL){printf("error"); return;}
for(p=q;p-q=n;p++)
fprintf(fp,"%23s%15s%15s\n",p-num,p-name,p-tel);
fclose(fp);
M++;
}
void mydelete(struct student *p,int n)
{
FILE *fp=NULL;
struct student *q=p;
char c[10]="",tempnum[10]="",tempname[10]="",temptel[10]="",choose='\0';
mydisplay(p,n);
printf("选择删除记录的方式:学号(h)姓名(m)");
choose=getche();
printf("\n");
if(choose=='m'||choose=='M')
{
printf("删除的记录:");
gets(c);
for(;p-qn;p++)
if(strcmp(c,p-name)==0) break;
if(p-qn)
for(;p-qn-1;p++)
{
strcpy(p-num,(p+1)-num);
strcpy(p-name,(p+1)-name);
strcpy(p-tel,(p+1)-tel);
}
else printf("no\n");
}
else if(choose=='h'||choose=='H')
{
printf("删除的记录:");
gets(c);
for(;p-qn;p++)
if(strcmp(c,p-num)==0) break;
if(p-qn)
for(;p-qn-1;p++)
{
strcpy(p-num,(p+1)-num);
strcpy(p-name,(p+1)-name);
strcpy(p-tel,(p+1)-tel);
}
else printf("no");
}
else printf("wrong\n");
fp=fopen("d:\\jilu.dat","w");
if(fp==NULL){printf("error"); return;}
for(p=q;p-qn-1;p++)
fprintf(fp,"%23s%15s%15s\n",p-num,p-name,p-tel);
fclose(fp);
M--;
}
void mysort(struct student *p,int n)
{
FILE *fp=NULL;
struct student *q=p,*w=p,*a=p;
char temp[10]="",c1='\0',c2='\0';
mydisplay(p,n);
printf("选择按照学号(h)或姓名(m)排序:\n");
c1=getche();
if(c1=='h'||c1=='H')
{
printf("升序(s)或者降序(j)排列:");
c2=getche();
if(c2=='s'||c2=='S')
for(;p-an;p++)
{
w=p;
for(q=p+1;q-an;q++)
if(strcmp(w-num,q-num)0) w=q;
strcpy(temp,w-num);
strcpy(w-num,p-num);
strcpy(p-num,temp);
strcpy(temp,w-name);
strcpy(w-name,p-name);
strcpy(p-name,temp);
strcpy(temp,w-tel);
strcpy(w-tel,p-tel);
strcpy(p-tel,temp);
}
else if(c2=='j'||c2=='J')
for(;p-an;p++)
{
w=p;
for(q=p+1;q-an;q++)
if(strcmp(w-num,q-num)0) w=q;
strcpy(temp,w-num);
strcpy(w-num,p-num);
strcpy(p-num,temp);
strcpy(temp,w-name);
strcpy(w-name,p-name);
strcpy(p-name,temp);
strcpy(temp,w-tel);
strcpy(w-tel,p-tel);
strcpy(p-tel,temp);
}
else printf("555wrong...\n");
}
else if(c1=='m'||c1=='M')
{
printf("升序(s)或者降序(j)排列:");
c2=getche();
if(c2=='s'||c2=='S')
for(;p-an;p++)
{
w=p;
for(q=p+1;q-an;q++)
if(strcmp(w-name,q-name)0) w=q;
strcpy(temp,w-num);
strcpy(w-num,p-num);
strcpy(p-num,temp);
strcpy(temp,w-name);
strcpy(w-name,p-name);
strcpy(p-name,temp);
strcpy(temp,w-tel);
strcpy(w-tel,p-tel);
strcpy(p-tel,temp);
}
else if(c2=='j'||c2=='J')
for(;p-an;p++)
{
w=p;
for(q=p+1;q-an;q++)
if(strcmp(w-name,q-name)0) w=q;
strcpy(temp,w-num);
strcpy(w-num,p-num);
strcpy(p-num,temp);
strcpy(temp,w-name);
strcpy(w-name,p-name);
strcpy(p-name,temp);
strcpy(temp,w-tel);
strcpy(w-tel,p-tel);
strcpy(p-tel,temp);
}
else printf("555wrong...\n");
}
else printf("555wrong...\n");
fp=fopen("d:\\jilu.dat","w");
if(fp==NULL){printf("error"); return;}
for(p=a;p-a=n;p++)
fprintf(fp,"%23s%15s%15s\n",p-num,p-name,p-tel);
fclose(fp);
}
main()
{
char choose='\0',yes_no='\0';
struct student record[N]={0};
do
{
myprint();
printf(" :-)请选择(0-7):");
choose=getche();
switch(choose)
{
case '1':mycreat(record,M);break;
case '2':mydisplay(record,M);break;
case '3':mysearch(record,M);break;
case '4':mymodify(record,M);break;
case '5':myadd(record,M);break;
case '6':mydelete(record,M);break;
case '7':mysort(record,M);break;
case '0':exit(0);
default :printf("\nerror...\n");
}
printf("\n :-)继续选择吗(y/n)?\n");
do
{yes_no=getch();}
while(yes_no!='Y'yes_no!='y'yes_no!='N'yes_no!='n');
}while(yes_no=='Y'||yes_no=='y');
}