FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour URGENT - Serial number over network
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
URGENT - Serial number over network
Posted: Wed Jan 31, 2007 08:14 PM

Hi Everybody,

I have a situation that I hope someone can help with....

I use a "software key" to protect my application from unauthorized copies.
The key is based on the serial number of the hard drive (nSerialHD())

I have just been asked if it is possible to install my program on a network and have others access the .exe via a shared drive letter.

The program runs but of course it looks at the LOCAL computers hard drive for the serial number not where the program is actually sitting (lets say drive X:)

Is it possible to get the serial number of the system where the program is sitting?

Thanks,

Jeff

Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: URGENT - Serial number over network
Posted: Wed Jan 31, 2007 08:36 PM
You may try

nSerialHD( "X:\" )


where X is the network mapped drive but I'm not sure it will work.

EMG
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
URGENT - Serial number over network
Posted: Thu Feb 01, 2007 09:01 AM

Jeff,

You may want to try searching the forum for this. I seem to remember some discussion about this awhile back.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 310
Joined: Sun Jan 08, 2006 10:09 PM
URGENT - Serial number over network
Posted: Thu Feb 01, 2007 01:29 PM

Hello Friends

I use one proprietary solution, geting a serial number in the server with nSerialHD, inputing a password code liberation and saving inside .EXE. The application runs on other computer with no problems, but don't moved.

Original post in http://www.pctoledo.com.br/forum/viewtopic.php?t=3275

But you can test NSLock.OCX too, review this post:

http://fivetechsoft.com/forums/viewtopi ... ght=nslock

Posts: 310
Joined: Sun Jan 08, 2006 10:09 PM
URGENT - Serial number over network
Posted: Thu Feb 01, 2007 01:48 PM
Hii

I found this too:

#include "struct.ch"

function NetSerialNumber()
   local oNCB, oAdapterStatus, cBuffer
   STRUCT oNCB
      MEMBER command  AS BYTE
      MEMBER retcode  AS BYTE
      MEMBER lsn      AS BYTE
      MEMBER num      AS BYTE
      MEMBER buffer   AS LONG
      MEMBER length   AS LONG
      MEMBER callname AS STRING LEN 16
      MEMBER name     AS STRING LEN 16
      MEMBER rto      AS BYTE
      MEMBER sto      AS BYTE
      MEMBER post     AS LONG
      MEMBER lana_num AS BYTE
      MEMBER cmd_cplt AS BYTE
      MEMBER reserve  AS STRING LEN 10
      MEMBER event    AS LONG
      MEMBER dummy    AS STRING LEN 30
   ENDSTRUCT
   STRUCT oAdapterStatus
      MEMBER address           AS STRING LEN 6
      MEMBER rev_major         AS BYTE
      MEMBER reserved0         AS BYTE
      MEMBER adapter_type      AS BYTE
      MEMBER rev_minor         AS BYTE
      MEMBER duration          AS LONG
      MEMBER frmr_recv         AS LONG
      MEMBER frmr_xmit         AS LONG
      MEMBER iframe_recv_err   AS LONG
      MEMBER xmit_aborts       AS LONG
      MEMBER xmit_success      AS LONG
      MEMBER recv_success      AS LONG
      MEMBER iframe_xmit_err   AS LONG
      MEMBER recv_buff_unavail AS LONG
      MEMBER t1_timeouts       AS LONG
      MEMBER ti_timeouts       AS LONG
      MEMBER reserved1         AS LONG
      MEMBER free_ncbs         AS LONG
      MEMBER max_cfg_ncbs      AS LONG
      MEMBER max_ncbs          AS LONG
      MEMBER xmit_buf_unavail  AS LONG
      MEMBER max_dgram_size    AS LONG
      MEMBER pending_sess      AS LONG
      MEMBER max_cfg_sess      AS LONG
      MEMBER max_sess          AS LONG
      MEMBER max_sess_pkt_size AS LONG
      MEMBER name_count        AS LONG
   ENDSTRUCT
   oNcb:command = 50 // NCBRESET
   MsgInfo( oNcb:command )
   MsgInfo( Netbios( oNcb:cBuffer ) )
   MsgInfo( oNcb:retcode )
   oNcb:command  = 51 // NCBASTAT
   oNcb:buffer   = GETVDMP32( StrPtr( oAdapterStatus:cBuffer ) )
   oNcb:length   = oAdapterStatus:SizeOf()
   oNcb:callname = "*" + space( 15 )
   MsgInfo( Netbios( oNcb:cBuffer ) )
   MsgInfo( oNcb:retcode )

return DecToHex( Asc( SubStr( oAdapterStatus:address, 1, 1 ) ) ) + ;
       DecToHex( Asc( SubStr( oAdapterStatus:address, 2, 1 ) ) ) + ;
       DecToHex( Asc( SubStr( oAdapterStatus:address, 3, 1 ) ) ) + ;
       DecToHex( Asc( SubStr( oAdapterStatus:address, 4, 1 ) ) ) + ;
       DecToHex( Asc( SubStr( oAdapterStatus:address, 5, 1 ) ) ) + ;
       DecToHex( Asc( SubStr( oAdapterStatus:address, 6, 1 ) ) )

DLL32 FUNCTION Netbios( pncb AS LPSTR ) AS LONG PASCAL LIB "NETAPI32.DLL"
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
URGENT - Serial number over network
Posted: Fri Feb 02, 2007 12:23 AM

Thanks everybody.

Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)
Posts: 38
Joined: Thu May 11, 2006 07:41 PM
posible solucion
Posted: Wed Feb 07, 2007 01:20 PM

Trata de que se revise o chequee el numero serial solo y exclusivamente desde el equipo servidor con una funcion de CTIII que se llama NETDISK()
o algo parecido de esta manera cualquiera estacion de trabajo no verifica este numero y podra correr libremente, a mi me funciona pruebala.
Saludos
Rodolfo Silva

sildata@cantv.net

Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
URGENT - Serial number over network
Posted: Thu Feb 08, 2007 09:31 AM

How I can show in a window all pc link to me ( server) ?

Best Regards, Saludos



Falconi Silvio
Posts: 115
Joined: Mon Oct 17, 2005 04:42 AM
URGENT - Serial number over network
Posted: Fri Feb 09, 2007 10:59 AM
Hello rochinha,

From where can I get NLSOCK.OCX ?

With best regards,

Milan.

Rochinha wrote:Hello Friends

I use one proprietary solution, geting a serial number in the server with nSerialHD, inputing a password code liberation and saving inside .EXE. The application runs on other computer with no problems, but don't moved.

Original post in http://www.pctoledo.com.br/forum/viewtopic.php?t=3275

But you can test NSLock.OCX too, review this post:

http://fivetechsoft.com/forums/viewtopi ... ght=nslock
Posts: 310
Joined: Sun Jan 08, 2006 10:09 PM
URGENT - Serial number over network
Posted: Fri Feb 09, 2007 03:41 PM
Here

Macoratti.NET

This is my test:
// FiveWin ActiveX support demo - Using Adobe Acrobat Reader

#include "FiveWin.ch"

function Main()

   local oWnd, oActiveX, cLiberationKey := space(16)

   DEFINE WINDOW oWnd TITLE "FiveWin ActiveX Support"

   oActiveX = TActiveX():New( oWnd, "nslock15vb5.ActiveLock" )

   oActiveX:Do( "Password"           , "rochinha" )
   oActiveX:Do( "SoftwareName"       , "5Volution" )
   oActiveX:Do( "LiberationKeyLength", 16 )
   oActiveX:Do( "SoftwareCodeLength" , 16 )

   //? oActiveX:GetProp( "SoftwareCode" )

   if ! oActiveX:GetProp( "RegisteredUser" )
      MsgGet( "Entre a chave de liberacao",; // Title
              "Chave:",;                     // Label
              @cLiberationKey )              // A variable by reference
      oActiveX:Do( "LiberationKey", cLiberationKey )
   endif

   if ! oActiveX:GetProp( "RegisteredUser" )
      if oActiveX:GetProp( "LastRunDate" ) > date()
         ? 'Data foi retrocedida. Programa sera encerrado'
      else
         ? 'Faltam ' + Str( 30 - oActiveX:GetProp( "UsedDays" ) ) + ' dias.'
      endif
      ? 'DEMONSTRACAO'
      oWnd:cCaption := 'DEMONSTRACAO'
      SysRefresh()
   else
      ? 'REGISTRADO'
      oWnd:cCaption := 'REGISTRADO'
      SysRefresh()
   endif

   //oWnd:oClient = oActiveX // To fill the entire window surface

   ACTIVATE WINDOW oWnd 

return nil


I'm test in Windows Server 2003.

Continue the discussion