Create Serial Number

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Arne Beruldsen

    Create Serial Number

    I have a windows app using vb.net 2005.

    I would like to create a serial number based on a couple of characteristics
    of the customers computer (computer name, HD number..etc). I don't need
    anything complicated just a way to generate a 16 character number.

    Is there an easy way to do this...?

    Thanks
  • Cor Ligthert [MVP]

    #2
    Re: Create Serial Number

    Arne,

    I don't see what is the problem with that. If it is based on existing
    numbers than it is concatenating.

    Can you explain to us what is the diffficult with this.

    Be aware that it will never be a Global Unique ID. Therefore you need the
    GUID and more positions.



    Cor
    "Arne Beruldsen" <ArneBeruldsen@ discussions.mic rosoft.comschre ef in
    bericht news:5512E02C-7E3A-4FDA-A7B3-59632B2277FD@mi crosoft.com...
    >I have a windows app using vb.net 2005.
    >
    I would like to create a serial number based on a couple of
    characteristics
    of the customers computer (computer name, HD number..etc). I don't need
    anything complicated just a way to generate a 16 character number.
    >
    Is there an easy way to do this...?
    >
    Thanks

    Comment

    • Paul Bromley

      #3
      Re: Create Seirial Number

      In my applicattion, I used an encrpted string based on a number of features
      of the user machine and my program. I created an encryption program to
      create the encrypted string, and within the user program is the same
      encryption function to check that the two strings are equal. The function I
      used is below:-

      Imports System.Text
      Imports System.Security .Cryptography
      Module modEncrypt
      Public Function HashData(ByVal s As String) As String
      'Convert the string to a byte array
      Dim bytDataToHash As Byte() = _
      (New UnicodeEncoding ()).GetBytes(s)
      'Compute the MD5 hash algorithm
      Dim bytHashValue As Byte() = _
      New MD5CryptoServic eProvider().Com puteHash(bytDat aToHash)
      Return BitConverter.To String(bytHashV alue)
      End Function
      End Module

      Best wishes

      Paul Bromley


      "Arne Beruldsen" <ArneBeruldsen@ discussions.mic rosoft.comwrote in message
      news:5512E02C-7E3A-4FDA-A7B3-59632B2277FD@mi crosoft.com...
      >I have a windows app using vb.net 2005.
      >
      I would like to create a serial number based on a couple of
      characteristics
      of the customers computer (computer name, HD number..etc). I don't need
      anything complicated just a way to generate a 16 character number.
      >
      Is there an easy way to do this...?
      >
      Thanks

      Comment

      • Bildoss

        #4
        request

        'bytDataToHash' denotes a 'variable' where a 'method' was expected

        What error is this? how to correct the code



        EggHeadCafe.com - .NET Developer Portal of Choice

        Comment

        • Bildoss

          #5
          request

          'bytDataToHash' denotes a 'variable' where a 'method' was expected

          What error is this? how to correct the code in C#




          EggHeadCafe.com - .NET Developer Portal of Choice

          Comment

          • Herfried K. Wagner [MVP]

            #6
            Re: request

            <Bildossschrieb :
            'bytDataToHash' denotes a 'variable' where a 'method' was expected
            >
            What error is this? how to correct the code in C#
            You can correct it by posting your question to a C# newsgroup.

            --
            M S Herfried K. Wagner
            M V P <URL:http://dotnet.mvps.org/>
            V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

            Comment

            • Rad [Visual C# MVP]

              #7
              Re: request

              On Fri, 09 Mar 2007 00:08:48 -0800, Bildoss wrote:
              'bytDataToHash' denotes a 'variable' where a 'method' was expected
              >
              What error is this? how to correct the code
              >
              EggHeadCafe.com - .NET Developer Portal of Choice
              http://www.eggheadcafe.com
              Probably the compiler is expecting bytDataToHash()
              --
              Bits.Bytes

              Comment

              Working...