// VCLibDemo.cpp : 定义应用程序的入口点。
//

#include "stdafx.h"
#include "jydisk.h"
#include<iostream>
//#include <afxwin.h>  
#include <windef.h>
#include <sstream>
//#include <cctype>
#include <algorithm>
using namespace std;
//#pragma comment(lib,"jydisk.lib")
/*string MyGetFileExt(string fn)
{
	int i=fn.find_last_of('.');
	if (i==-1) return "";
	string s=fn.substr(i,fn.length());
	transform(s.begin(),s.end(),s.begin(),tolower);
	return s;
}*/
int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR     lpCmdLine,
                     int       nCmdShow)
{
 // TODO: Place code here.
	_Init();
	int il=0,k=0;
	 char p[1000];
	 wchar_t wp[1000];
	   __int64 t1,t2;
	   JyHDiskInfo ainfo;
	 char str[100];
	 
	  //----------
	 LARGE_INTEGER maxsize;
	 maxsize.QuadPart=10;
	 string sa;
	 // if (IsCrack(maxsize,10,sa))
	 //  {MessageBoxA(0,"win64","",0);}
	  // else
	  // {MessageBoxA(0,"win32","",0);}
	  //-----------------
	  	  
	   //il=GetPhysicalDriveCount(p,k);
	  // GetBiosID(p,k);
	   //GetDisplayDeviceID(p,k);
	   //GetDiskTypeStr(2,wp,k);
	 //k=GetDiskPartitionIndex('f');
	 string sss="E:\\HsjVcl\\有问题的文件只能用reader5.pdf";
     
	 string user="jydisk64|171833017";
	 string regid="";
	 _DoReg(user.c_str(),user.length(),regid.c_str(),regid.length());

	 //string ss=GetDiskInformation_zero(0);
	 //MessageBoxA(0,ss.c_str(),ss.c_str(),0);
	 /*if (IsRegisted())
	 {
	 MessageBoxA(0,"ok","",0);
	 }
	 else
	 {
	 MessageBoxA(0,"no","",0);
	 }
	 GetDisplayDeviceID(p,k);*/
	 //GetDiskSerialNumber1('c',p,k);
	 char pVolumeName[100],pVolumeSerialNumber[100],pPartitionType[100];
	 int pVolumeNameSize,pVolumeSerialNumberSize,pPartitionTypeSize;
	 __int64 TotalSpace,TotalFreeSpace;
	 //GetHardDiskPartitionInfo('g', pVolumeName,pVolumeNameSize,pVolumeSerialNumber,pVolumeSerialNumberSize, pPartitionType, pPartitionTypeSize, TotalSpace, TotalFreeSpace);
	_GetDiskSerialNumber2(0,p,k);	
	 _itoa_s(k,str,10);
		string s=str;
	   string t=""; 
	   for (int i=1;i<=k;i++)
		   t=t+p[i-1];
	   MessageBoxA(0,t.c_str(),s.c_str(),0);
	   //t=pVolumeName;
	   //t=t+";"+pVolumeSerialNumber+";"+pPartitionType;
	   JyHDiskInfo ainfo1;
	   _GetDiskInfo(0,ainfo1);
	   t=ainfo1.SerialNumber;
	   MessageBoxA(0,t.c_str(),s.c_str(),0);
	return 0;	
}



