// wordkey.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include "string.h" void enkey(char *ch) { unsigned char tc=*ch; unsigned char tm=0; tm=tc<<1; tc=tc<<1; tc=tc|(tm&0xff); *ch=(unsigned char)tc; } void unenkey(char *ch) { unsigned char tc=*ch; unsigned char tm=0; tm=tc<<7; tc=tc>>1; tm=tm<<7; tc=tc|tm; *ch=(unsigned char)tc; } int main(int argc, char* argv[]) { char tch[1000]="犱揿胰输zΒ槥槉垊//bv犅骀钷淙z氯谝躹犑滏益鐯κ脐湟栩@捾剔zㄤ晔v输@拡z媛v捾诣衣谸喡杪剞蝯磫枖埪杪v埪杪@赇剖z//"; char ch[1000]="Provider=SQLOLEDB.1;Password=admin;Persist Security Info=True;User ID=sa;Initial Catalog=ZCKJData;Data Source=."; FILE *file=NULL; file=fopen("d://x.txt","w+"); for(int i=0;i<strlen(ch);i++) { enkey(&ch[i]); printf("%c",ch[i]); } fprintf(file,"%s",ch); fclose(file); printf("/n"); for(i=0;i<strlen(tch);i++) { unenkey(&tch[i]); } printf("%s/n",tch); return 0; } 2010-08-23 21:33:04