Ejemplo n.º 1
0
void CDLGhdddelete::OnOK() 
{
	// TODO: Add extra validation here
	UpdateData(TRUE);
	int i;

	char str[32];
	int check;

		SQLDB.Begin();
	for( i=0;i<m_list.GetItemCount();i++)
	{
		m_list.GetItemText(i,6,str,32);
		check=m_list.GetCheck(i);

		if(check)
		{
			SQLDB.File_DeleteforHdd(_atoi64(str));
			SQLDB.Hdd_DeleteforHdd(_atoi64(str));
			SQLDB.Dir_DeleteforHdd(_atoi64(str));
		}
	}
		SQLDB.Commit();

	MessageBox(ConvertString("删除完毕"),NULL);

	hddList.clear();
	SQLDB.Hdd_Read(hddList);
	DisplayerList() ;

}
Ejemplo n.º 2
0
void CDLGhdddelete::DisplayerList() 
{
	hddList.clear();
	SQLDB.Hdd_Read(hddList);
	m_list.DeleteAllItems();

	char str[32];
	int i=0;
	list<struct HDD_ST>::iterator beglist;

	for(beglist=hddList.begin();beglist!=hddList.end();beglist++)
	{
		m_list.InsertItem(i,beglist->serno);

		m_list.SetItemText(i,1,beglist->area);
		m_list.SetItemText(i,2,beglist->mark);

		sprintf(str,"%.3fG",(double)(beglist->TotalBytes/1024/1024)/1024.0);
		m_list.SetItemText(i,3,str);
		sprintf(str,"%.3fG",(double)(beglist->FreeBytes/1024/1024)/1024.0);
		m_list.SetItemText(i,4,str);

		if(beglist->insertflag)
			m_list.SetItemText(i,5,ConvertString("接入<--"));
		else
			m_list.SetItemText(i,5,ConvertString("脱机-->"));

		sprintf(str,"%d",beglist->hdd_nid);
		m_list.SetItemText(i,6,str);

		m_list.SetItemText(i,7,beglist->format);

		i++;
	}
}
Ejemplo n.º 3
0
void CZogvmDlg::OnButtonBuild() 
{
	// TODO: Add your control notification handler code here
	GetDlgItem(IDC_BUTTON_BUILD)->EnableWindow(FALSE);


aaaa=GetTickCount();
	SQLDB.Begin();
	SQLDB.Hdd_SetNonsert();
	CDLGHdd::Add27HDDid();
	SQLDB.Commit();

	hddList.clear();
	//几个硬盘开几个线程
	SQLDB.Hdd_Read(hddList);
	
	bool flag=false;
	list<struct HDD_ST>::iterator beglist;

	for(beglist=hddList.begin();beglist!=hddList.end();beglist++)
	{
		beglist->dealstep=DEALSTEP_ALL_END;
		if(beglist->insertflag && beglist->enable)
		{
			flag=true;
			beglist->dealstep=DEALSTEP_START;
			CreateThread(NULL,0,BuildThreadPROC,(void*)&(*beglist),0,NULL);
		}
	}

	if(false == flag)
		GetDlgItem(IDC_BUTTON_BUILD)->EnableWindow(TRUE);

}
Ejemplo n.º 4
0
DWORD WINAPI DoubleThreadPROC(LPVOID lpParameter)
{
	list<struct HDD_ST> temphddList;
	temphddList.clear();
	SQLDB.Hdd_Read(temphddList);

//	CDLGhdddelete *Pdlg=(CDLGhdddelete *)lpParameter;

	list<struct HDD_ST>::iterator beglist;

	for(beglist=temphddList.begin();beglist!=temphddList.end();beglist++)
	{
		//查看重复文件
		CheckAllDoubleFile(beglist->hdd_nid,"");
	}


	return 0;
}
Ejemplo n.º 5
0
DWORD WINAPI BuildThreadPROC(LPVOID lpParameter)
{

	CZogvmDlg *pDlg=(CZogvmDlg *)lpParameter;

	char tempstr[256];

	pDlg->hddList.clear();
	//几个硬盘开几个线程
	SQLDB.Hdd_Read(pDlg->hddList);

	list<struct FILETYPE_ST> typeList;
	typeList.clear();
	SQLDB.Type_Read(typeList); 

	list<struct ZIDIAN_ST> zidianList;
	zidianList.clear();
	SQLDB.ZiDian_Read(zidianList); 

	list<struct HDD_ST>::iterator beglist;

	for(beglist=pDlg->hddList.begin();beglist!=pDlg->hddList.end();beglist++)
	{
		if(beglist->insertflag && beglist->enable)
		{
			sprintf(tempstr,ConvertString("%s %s :建目录中.."),beglist->serno,beglist->mark);
			pZogvmDlg->GetDlgItem(IDC_STATIC_MSG)->SetWindowText(tempstr);

			//建目录
			FindAllFile_NEW(beglist->hdd_nid,beglist->area,typeList,zidianList);

			//缺少 关联 IDX代码
			SQLDB.File_CleanIDX(beglist->hdd_nid);

			sprintf(tempstr,ConvertString("%s %s :判断文件是否存在.."),beglist->serno,beglist->mark);
			pZogvmDlg->GetDlgItem(IDC_STATIC_MSG)->SetWindowText(tempstr);
			//查看文件是否存在
			CheckAllIsFile(beglist->hdd_nid);

		}
	}

	for(beglist=pDlg->hddList.begin();beglist!=pDlg->hddList.end();beglist++)
	{
		if(beglist->insertflag && beglist->enable)
		{
			sprintf(tempstr,ConvertString("%s %s :判断重复文件.."),beglist->serno,beglist->mark);
			pZogvmDlg->GetDlgItem(IDC_STATIC_MSG)->SetWindowText(tempstr);
			//查看重复文件
			CheckAllDoubleFile(beglist->hdd_nid);
		}
	}

	bbbb=GetTickCount()-aaaa;
	sprintf(tempstr,ConvertString("全部扫描完毕~么么哒 耗时%I64u分钟"),bbbb/60000);
	pZogvmDlg->GetDlgItem(IDC_STATIC_MSG)->SetWindowText(tempstr);
	pZogvmDlg->GetDlgItem(IDC_BUTTON_BUILD)->EnableWindow(TRUE);
	

	return 0;
}
Ejemplo n.º 6
0
DWORD WINAPI ExeclThreadPROC(LPVOID lpParameter)
{
	char path[260];
	strcpy(path,(char *)lpParameter);

	unsigned short fontsize=256;
	workbook w;
	worksheet **sheet;
	long sheetTotal=0;
	long long *filenum;
	xf_t *xf = NULL;

	int i=0;
	long j,k,m;
	SYSTEMTIME   systime;
	FILETIME  temptime;
	ULARGE_INTEGER  uli; 
	int ret;

	char str[2048];
	wchar_t wbuff[2048];

	list<struct HDD_ST> MyhddList;

	SQLDB.Hdd_SetNonsert();
	CDLGHdd::Add27HDDid();

	MyhddList.clear();
	SQLDB.Hdd_Read(MyhddList);
	if(MyhddList.size()<=0)
	{
		MessageBox(NULL,"没有硬盘","导出EXECL",MB_OK);
		return 0;
	}
	//导出硬盘
	sheetTotal=1;
	sheet=(worksheet **)calloc(sheetTotal,sizeof(worksheet *));
	filenum=(long long *)calloc(MyhddList.size(),sizeof(long long));

	xf= w.xformat(); 
	//xf->SetLocked(true) ;无效代码

	sheet[0]=w.sheet(L"硬盘目录");
	sheet[0]->colwidth(0,10*fontsize);
	sheet[0]->label(0,0,L"磁盘序列号");
	sheet[0]->colwidth(1,10*fontsize);
	sheet[0]->label(0,1,L"分区");
	sheet[0]->colwidth(2,30*fontsize);
	sheet[0]->label(0,2,L"标签");
	sheet[0]->colwidth(3,20*fontsize);
	sheet[0]->label(0,3,L"总空间");
	sheet[0]->colwidth(4,20*fontsize);
	sheet[0]->label(0,4,L"剩余空间");

	list<struct HDD_ST>::iterator beglist;

	for(i=1,beglist=MyhddList.begin();beglist!=MyhddList.end();i++,beglist++)
	{
		MultiByteToWideChar(CP_ACP, 0, beglist->serno, -1, wbuff, 2048);  
		sheet[0]->label(i,0,wbuff);
		MultiByteToWideChar(CP_ACP, 0, beglist->area, -1, wbuff, 2048);  
		sheet[0]->label(i,1,wbuff);
		MultiByteToWideChar(CP_ACP, 0, beglist->mark, -1, wbuff, 2048);  
		sheet[0]->label(i,2,wbuff);
		sprintf(str,"%I64u",beglist->TotalBytes);
		MultiByteToWideChar(CP_ACP, 0, str, -1, wbuff, 2048);  
		sheet[0]->label(i,3,wbuff);
		sprintf(str,"%I64u",beglist->FreeBytes);
		MultiByteToWideChar(CP_ACP, 0, str, -1, wbuff, 2048); 
		sheet[0]->label(i,4,wbuff);
		
		filenum[i-1]=SQLDB.File_NumberForHDD(beglist->hdd_nid);
		sheetTotal += (long)(filenum[i-1]/10000) +1;
		
	}
	
	//导出文件
	sheet=(worksheet **)realloc(sheet,sheetTotal*sizeof(worksheet *));

	outputList.clear();

	list<struct FILE_VIEW_ST>::iterator filebeglist;

	k=1;

	for(i=0,beglist=MyhddList.begin();beglist!=MyhddList.end();i++,beglist++)
	{
		if(filenum[i] <= 0)
			continue;

		for(j=0;j< (long)(filenum[i]/10000) +1;j++)
		{
			sprintf(str,"%s %s %d",beglist->serno,beglist->mark,j);
			MultiByteToWideChar(CP_ACP, 0, str, -1, wbuff, 2048); 
			sheet[k]=w.sheet(wbuff);
		
			sheet[k]->colwidth(0,10*fontsize);
			sheet[k]->label(0,0,L"序号");
			sheet[k]->colwidth(1,150*fontsize);
			sheet[k]->label(0,1,L"文件路径");
			sheet[k]->colwidth(2,5*fontsize);
			sheet[k]->label(0,2,L"类型");
			sheet[k]->colwidth(3,5*fontsize);
			sheet[k]->label(0,3,L"后缀");
			sheet[k]->colwidth(4,20*fontsize);
			sheet[k]->label(0,4,L"创建时间");
			sheet[k]->colwidth(5,20*fontsize);
			sheet[k]->label(0,5,L"修改时间");
			sheet[k]->colwidth(6,15*fontsize);
			sheet[k]->label(0,6,L"文件大小");
			sheet[k]->colwidth(7,10*fontsize);
			sheet[k]->label(0,7,L"分辨率");
			sheet[k]->colwidth(8,5*fontsize);
			sheet[k]->label(0,8,L"3D");

			outputList.clear();
			SQLDB.File_ReadHddPage(outputList,beglist->hdd_nid,true,j*10000,10000);

			if(outputList.size() <= 0)
				continue;

			for(m=1,filebeglist=outputList.begin();filebeglist!=outputList.end();m++,filebeglist++)
			{
				sprintf(str,"%I64u",filebeglist->file_data.file_nid);
				MultiByteToWideChar(CP_ACP, 0, str, -1, wbuff, 2048); 
				sheet[k]->label(m,0,wbuff);

				sprintf(str,"%s%s",filebeglist->file_data.path,filebeglist->file_data.name);
				MultiByteToWideChar(CP_ACP, 0, str, -1, wbuff, 2048); 
				sheet[k]->label(m,1,wbuff);

				sprintf(str,"%s",MainType2Str(filebeglist->file_data.maintype));
				MultiByteToWideChar(CP_ACP, 0, str, -1, wbuff, 2048); 
				sheet[k]->label(m,2,wbuff);

				MultiByteToWideChar(CP_ACP, 0, filebeglist->file_data.type, -1, wbuff, 2048); 
				sheet[k]->label(m,3,wbuff);
	
				if(filebeglist->file_data.CreationTime)
				{
					uli.QuadPart=filebeglist->file_data.CreationTime;
					temptime.dwLowDateTime=uli.LowPart;
					temptime.dwHighDateTime=uli.HighPart;
					FileTimeToSystemTime(&temptime,&systime);

					sprintf(str,"%04d-%02d-%02d %02d:%02d:%02d", 
						systime.wYear,systime.wMonth,systime.wDay,
						systime.wHour,systime.wMinute,systime.wSecond);

					MultiByteToWideChar(CP_ACP, 0, str, -1, wbuff, 2048); 
					sheet[k]->label(m,4,wbuff);
				}

				if(filebeglist->file_data.LastWriteTime)
				{
					uli.QuadPart=filebeglist->file_data.LastWriteTime;
					temptime.dwLowDateTime=uli.LowPart;
					temptime.dwHighDateTime=uli.HighPart;
					FileTimeToSystemTime(&temptime,&systime);

					sprintf(str,"%04d-%02d-%02d %02d:%02d:%02d", 
						systime.wYear,systime.wMonth,systime.wDay,
						systime.wHour,systime.wMinute,systime.wSecond);

					MultiByteToWideChar(CP_ACP, 0, str, -1, wbuff, 2048); 
					sheet[k]->label(m,5,wbuff);
				}

				sprintf(str,"%I64u",filebeglist->file_data.filesize);
				MultiByteToWideChar(CP_ACP, 0, str, -1, wbuff, 2048); 
				sheet[k]->label(m,6,wbuff);

				MultiByteToWideChar(CP_ACP, 0, filebeglist->file_data.zidian_fenbianlv , -1, wbuff, 2048); 
				sheet[k]->label(m,7,wbuff);
				
				MultiByteToWideChar(CP_ACP, 0, filebeglist->file_data.zidian_3d, -1, wbuff, 2048); 
				sheet[k]->label(m,8,wbuff);
			}

			k++;

		}
	}
	
	MyhddList.clear();
	outputList.clear();
	MultiByteToWideChar(CP_ACP, 0, path, -1, wbuff, 2048);  
	ret = w.Dump(wbuff);

	free(filenum);
	free(sheet);
	pZogvmDlg->GetDlgItem(IDC_BUTTON_OUTPUTEXECL)->EnableWindow(TRUE);

	if (ret != 0)
	{
		MessageBox(NULL,"导出失败","导出EXECL",MB_OK);
		return 0;
	}

	MessageBox(NULL,"导出完成","导出EXECL",MB_OK);

	return 0;
}