serial number SD CARD

serial number SD CARD

Postby Otto » Wed Jul 01, 2009 4:44 pm

How to get serial number of a SD CARD?
Thanks in advance
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 5993
Joined: Fri Oct 07, 2005 7:07 pm

Re: serial number SD CARD

Postby Richard Chidiak » Thu Jul 02, 2009 3:04 am

Otto

test anyfile on the sd

sample

NSER := NumserieTarjeta(Fopen(curdir()+"\CBATIPKSAV.EXE") )

hth

Richard

Code: Select all  Expand view


#pragma BEGINDUMP

#include <hbapi.h>
#include <windows.h>
#include <aygshell.h>

HB_FUNC( NUMSERIETARJETA )
{
BY_HANDLE_FILE_INFORMATION bHinfo;

memset( &bHinfo, 0 , sizeof(bHinfo) );

GetFileInformationByHandle( (HANDLE) hb_parnl(1), &bHinfo );
hb_retnl( bHinfo.dwVolumeSerialNumber );

}


#pragma ENDDUMP



 
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
User avatar
Richard Chidiak
 
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France

Re: serial number SD CARD

Postby Otto » Thu Jul 02, 2009 10:30 am

Hello Richard,

Thank you for your help. I get back a number. It is working.

Do I understand the code right: F_open creates a file handle which you pass to GetFileInformationByHandle.
DwVolumeSerialNumber is a volume serial number, all files on that volume will have the same dwVolumeSerialNumber.

Do you know what happens if you xCopy one SDCARD to another.
Does the dwVolumeSerialNumber remain on the copy the same?

Thanks again,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 5993
Joined: Fri Oct 07, 2005 7:07 pm

Re: serial number SD CARD

Postby Richard Chidiak » Thu Jul 02, 2009 2:08 pm

Otto

Every SD card has its own serial number

if you "xcopy" all the files from one to another, you do not copy the serial number , you can just retreive it

HTH

Richard
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
User avatar
Richard Chidiak
 
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France

Re: serial number SD CARD

Postby Otto » Thu Jul 02, 2009 4:40 pm

Richard, thank you. That is good, that is what I need.
So I can use this number to protect the software.
Thanks again,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 5993
Joined: Fri Oct 07, 2005 7:07 pm


Return to FiveWin for Pocket PC

Who is online

Users browsing this forum: No registered users and 3 guests