现在的位置: 首页 > 综合 > 正文

自己写的test测试

2013年10月01日 ⁄ 综合 ⁄ 共 2520字 ⁄ 字号 评论关闭

#include<fstream.h>
#include<iostream.h>
//#include<windows.h>
#include<afx.h>
#define FT_COBOL   0x0010 /* COBOLソース */
#define FT_DEF    0x0020 /* モジュール定義ファイル*/
#define FT_LIB    0x0040 /* COBOLライブラリ */
#define FT_MAIN_COBOL  0x0080 /* MAIN指定COBOLソース */
#define FT_OBJ        0x0100 /* オブジェクト */
#define FT_EXE        0x0200 /* 実行ファイル */
#define FT_DLL        0x0201 /* ダイナミックリンクライブラリ */
#define FT_COPY        0x0400 /* COPYファイル */
#define FT_USER_LIB    0x0800 /* ユーザ作成ライブラリ */

typedef struct tagMFILELIST {
 struct tagMFILELIST *lpNext;
 char            lpFileName[10];
 char             lpfiledir[40];
 WORD              wFileType;
 int                  Mark;
}MFILELIST;

typedef MFILELIST *MYFILELIST;
void main()
{
 int i=0,j=0,k=0,flag=0;
 char out[100]="E:\\Sample\\Sample\\Sample03\\",in[100]="",name[10]="nihao";
  CString s1="",s2="";
        char drive[10];
     char dir[50];   
     char fname[10]; 
     char ext[10];
     while(out[i])
  {
   i++;
  }
  out[i++]='*';
  out[i++]='.';
  out[i++]='*';
  out[i]='\0';
  //int a=2049;
  // cout<<a<<endl;
     //GetCurrentDirectory(100,out) ;
       //MYFILELIST  myfile;
  // myfile=(MYFILELIST)malloc(sizeof(MFILELIST));
           cout<<out<<endl;
          BOOL    bWorking ;
           CFileFind   finder;     
           bWorking =   finder.FindFile(out);
         while   (bWorking)
   { 
            bWorking   =   finder.FindNextFile();
       //if   (finder.IsDots())
             // continue;     
            if   (!finder.IsDirectory())
   {
                 s2 =finder.GetFilePath();
    //cout<<s2<<endl;
    cout<<finder.GetFilePath()<<endl;
    _splitpath(s2, drive, dir, fname, ext);
      if(!strcmp(ext,".prj"))cout<<"1ok"<<endl;
   if((ext[1]=='p'&&ext[2]=='r'&&ext[3]=='j')||(ext[1]=='P'&&ext[2]=='R'&&ext[3]=='J'))cout<<"ok"<<endl;
            if((ext[1]=='c'&&ext[2]=='b'&&ext[3]=='i')||(ext[1]=='C'&&ext[2]=='B'&&ext[3]=='I'))cout<<"ok"<<endl;
   if((ext[1]=='c'&&ext[2]=='b'&&ext[3]=='i')||(ext[1]=='C'&&ext[2]=='B'&&ext[3]=='I'))cout<<"ok"<<endl;
      cout<<ext<<endl;
            //MessageBox(str);
                                                     //?理文件
   }
   }
       
       finder.Close();
   
 /*char drive[10];
 char dir[10];   
 char fname[10]; 
 char ext[10];
 _splitpath(out, drive, dir, fname, ext );
  cout<<fname<<endl;
  cout<<FT_USER_LIB<<endl;
 while(out[i])
 {  
        i++;
 }
    i--;
 while(out[i]!='\\')
 {
  i--;
 }
 
 for(j=0;j<i;j++)in[j]=out[j];

   /*for(i=0;i<5;i++)
   {

    name[i]=*s1;
    s1++;
    cout<<name<<endl;
   }*/
     //i=0;
    //s2=s1;
    //while(fname[i])
 //{
 // *(s1++)=fname[i++];
// }
   //  *(s1)='\0';
 
  /*
 cout<<i<<endl;
 cout<<out<<endl;
 cout<<in<<endl;
 cout<<name<<endl;
// cout<<s2<<endl;
*/
}

抱歉!评论已关闭.