Newsgroup: it.comp.lang.visual-basic
Titolo: protezione, serial number e computer name





se io volessi evitare che il mio (primo e unico) 
cliente scopiazzi il mio programma, che ho venduto solo a lui, potrei utilizzare 
fare in modo che il prog sia avviabile solo su una determinata macchina, 
identificata col serial numbe re con il computer name? non è che cambiano ad 
ogni avvio?


in pratica, io prima di compliare il prog, mi fare 
dare il serial number e il computer name, e li metterei proprio nella sub Main, 
in modo che lui controlli ogni volta se il computer è quello giusto... che ne 
dite?


ovviamente se il cliente vuole piu copie, faccio 
tante compilazioni quanti sono i PC su cui installare.


 


grazie


 


mario


 


 



 wrote in message
news:002f01c05564$7dcab0e0$54f02dd5@h2k6e7...


...



'
' --- Start of uselessness
'
' Disclaimer:
'
' The software is provided AS IS, and the author hereby disclaims all
' and every warranties and conditions, either express, implied or statutory,
' including, but not limited to, any (if any) implied warranties, duties or
' conditions of merchantability, of fitness for a particular purpose, of
' accuracy or completeness of responses, of results, of workmanlike effort,
' of lack of viruses, and of lack of negligence
'
' IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL,
' INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES
' WHATSOEVER (INCLUDING, BUT NOT LIMITED TO, DAMAGES
' FOR LOSS OF PROFITS OR CONFIDENTIAL OR OTHER
' INFORMATION, FOR BUSINESS INTERRUPTION, FOR PERSONAL
' INJURY, FOR LOSS OF PRIVACY, FOR FAILURE TO MEET ANY
' DUTY INCLUDING OF GOOD FAITH OR OF REASONABLE CARE,
' FOR NEGLIGENCE, AND FOR ANY OTHER PECUNIARY OR OTHER
' LOSS WHATSOEVER) ARISING OUT OF OR IN ANY WAY
' RELATED TO THE USE OF OR INABILITY TO USE THE SOFTWARE,
' EVEN IN THE EVENT OF THE FAULT, TORT (INCLUDING
' NEGLIGENCE), STRICT LIABILITY, AND EVEN IF THE AUTHOR
' HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
'
' By using the software you agree to be bound by the terms above.
'
' You can modify the software and use it for your programs, under the terms
of
' the GNU GENERAL PUBLIC LICENSE (GPL).
' By using the software you agree to be bound by the terms of the GNU GPL.
'
' See the free software foundation web site (
www.gnu.org
) for further
details
' about the GNU GPL.
' --- End of uselessness
Type HASH
    A As Byte
    B As Byte
    C As Byte
    D As Byte
    E As Byte
    F As Byte
    G As Byte
    H As Byte
End Type
Private Const A = 3
Private Const B = 5
Private Const C = 2
Function MAKE_HASH(PlainText$) As HASH
    Dim HSH_Temp As HASH
    Dim I&, J&, Y&(7), x&
    Dim S() As Byte
    If Len(PlainText) < 1 Then
        ' Hash di nessun testo
        HSH_Temp.A = 0
        HSH_Temp.B = 0
        HSH_Temp.C = 0
        HSH_Temp.D = 0
        HSH_Temp.E = 0
        HSH_Temp.F = 0
        HSH_Temp.G = 0
        HSH_Temp.H = 0
        MAKE_HASH = HSH_Temp
        Exit Function
    End If
    ' Codifica usando la parabola y = 3 * x ^ 2 + 5 * x + 2
    ' Cambiare le costanti per cambiare la parabola
    S = PlainText
    J = 0
    For I = 0 To 6
        ' Calcolo di Y
        For J = J To (I + 1) * (UBound(S) \ (Len(HSH_Temp) - 1))
            x = (x + S(J)) Mod 256
        Next J
        Y(I) = (A * x ^ 2 + B * x + C) Mod 256
    Next I
    ' Calcolo di Y
    For J = J To J + UBound(S) Mod (Len(HSH_Temp) - 1) - 1
        x = (x + S(J)) Mod 256
    Next J
    Y(I) = (A * x ^ 2 + B * x + C) Mod 256
    ' Assegnazione alla struttura di uscita
    HSH_Temp.A = Y(0)
    HSH_Temp.B = Y(1)
    HSH_Temp.C = Y(2)
    HSH_Temp.D = Y(3)
    HSH_Temp.E = Y(4)
    HSH_Temp.F = Y(5)
    HSH_Temp.G = Y(6)
    HSH_Temp.H = Y(7)
    MAKE_HASH = HSH_Temp
End Function
' ------- End of Code

 wrote in message
8vjeqf$ggp$1...@fe2.cs.interbusiness.it...


 wrote in message news:8vkpqg$cbr$1...@nslave3.tin.it...
