Results 1 to 14 of 14

Thread: Numero of processor

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2015
    Location
    ANTANANARIVO
    Posts
    464

    Numero of processor

    Hello VBForums
    Hello every one
    Gentelmans
    How to make for get the numero of processor for my computer
    Thank you in advance for help
    Cordially
    MADA

  2. #2
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: Numero of processor

    What "numero" are you talking about? The processor make and model? Why would you even need this?

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2015
    Location
    ANTANANARIVO
    Posts
    464

    Re: Numero of processor

    Hiii dilettante
    I just thought for learn of putting for protect my simple program EXE.
    Cordially
    MADA

  4. #4
    PowerPoster
    Join Date
    Sep 2006
    Location
    Egypt
    Posts
    2,579

    Re: Numero of processor

    Simple
    Code:
    MsgBox Environ$("NUMBER_OF_PROCESSORS")
    Advanced http://vbnet.mvps.org/index.html?cod..._processor.htm



  5. #5
    PowerPoster
    Join Date
    Sep 2006
    Location
    Egypt
    Posts
    2,579

    Re: Numero of processor

    Quote Originally Posted by MADA BLACK View Post
    I just thought for learn of putting for protect my simple program EXE.
    How can knowing number of processors help protect a program?



  6. #6
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: Numero of processor


  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2015
    Location
    ANTANANARIVO
    Posts
    464

    Re: Numero of processor

    4x2y
    Thank you very much for help
    But with this code i have a number (2) .......!!!!!????
    Cordially
    MADA

  8. #8
    PowerPoster
    Join Date
    Sep 2006
    Location
    Egypt
    Posts
    2,579

    Re: Numero of processor

    Quote Originally Posted by MADA BLACK View Post
    4x2y
    Thank you very much for help
    But with this code i have a number (2) .......!!!!!????
    Cordially
    MADA
    Do you mean number of processors (cores) or CPU serial number?



  9. #9
    PowerPoster ChrisE's Avatar
    Join Date
    Jun 2017
    Location
    Frankfurt
    Posts
    3,034

    Re: Numero of processor

    Hi Mada,

    try this..

    add a Listbox and a commandbutton.
    Code:
    Private Sub Command1_Click()
    GetCPUData
    End Sub
    
    Sub GetCPUData(Optional ByVal strComputerName As String = ".")
        
        '   Fehlerbehandlung
        On Error Resume Next
        
        Dim strSQL As String
        Dim strWMI As String
        
        Dim oWMI As Object
        Dim objItem As Object
        
        Dim lngOldMouse As Long
        
        'Mousecursor setzen (es ist eine längere Abfrage)
        lngOldMouse = Me.MousePointer
        Me.MousePointer = vbHourglass
        
        'Abfragen festlegen
        strSQL = "Select * from Win32_Processor"
        strWMI = "winmgmts:\\" & strComputerName & "\root\cimv2"
        
        'Abfrage durchführen
        Set oWMI = GetObject(strWMI).ExecQuery(strSQL)
     
        'Alle zurückgegebenen Objekte durchlaufen
        For Each objItem In oWMI
            'Gerätebezeichnung der CPU ausgeben
           List1.AddItem "Prozessor   : " & objItem.DeviceID
            'Name der CPU ausgeben
             List1.AddItem "  Name      : " & objItem.Name
            'maximale Taktfrequenz der CPU ausgeben
             List1.AddItem "  Takt (MHz): " & objItem.MaxClockSpeed
            'Prozessor-ID der CPU ausgeben
             List1.AddItem "  CPU ID    : " & objItem.ProcessorId
        Next
        
        '   Mousecoursor zurücksetzen
        MousePointer = lngOldMouse
    End Sub
    regards
    Chris
    to hunt a species to extinction is not logical !
    since 2010 the number of Tigers are rising again in 2016 - 3900 were counted. with Baby Callas it's 3901, my wife and I had 2-3 months the privilege of raising a Baby Tiger.

  10. #10

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2015
    Location
    ANTANANARIVO
    Posts
    464

    Re: Numero of processor

    Thank you very much dilettante for best link
    Cordially
    MADA

  11. #11

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2015
    Location
    ANTANANARIVO
    Posts
    464

    Re: Numero of processor

    Thank you ChrisE
    Thank you for help
    Exactly
    This is what i want .. thank you a lot
    A last question please
    if I formate my computer and i change for example version windows
    does this processor number change?
    Cordially
    MADA

  12. #12
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Numero of processor

    Can't see how. The processors are hardware, not software-related. The only way that could change is that whatever service/function you are calling to get the count can no longer determine the number of processors.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  13. #13
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: Numero of processor

    Don't rely on the admin scripting tool WMI. The WMI Service can be missing, stopped, or secured against standard user access. It is not meant to be used within application code.

  14. #14

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2015
    Location
    ANTANANARIVO
    Posts
    464

    Re: Numero of processor

    Lavolpe
    Dilittante
    Thank you very very much
    In your opinion masters .. how to make a simple protection of program exe " simple and basic protection "
    Cordially
    MADA

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width