Click here to Skip to main content
15,898,134 members
Home / Discussions / C#
   

C#

 
GeneralRe: Writing string expression to command line .. .- How to do it ? Pin
Yanshof16-Jun-08 21:40
Yanshof16-Jun-08 21:40 
GeneralRe: Writing string expression to command line .. .- How to do it ? Pin
Colin Angus Mackay16-Jun-08 21:50
Colin Angus Mackay16-Jun-08 21:50 
GeneralRe: Writing string expression to command line .. .- How to do it ? Pin
Yanshof16-Jun-08 22:25
Yanshof16-Jun-08 22:25 
GeneralRe: Writing string expression to command line .. .- How to do it ? Pin
Colin Angus Mackay16-Jun-08 22:30
Colin Angus Mackay16-Jun-08 22:30 
Questionchage image formate from jpeg,gif etc to bitmap .bmp Pin
Member 343561416-Jun-08 21:22
Member 343561416-Jun-08 21:22 
AnswerRe: chage image formate from jpeg,gif etc to bitmap .bmp Pin
Alan Balkany17-Jun-08 4:21
Alan Balkany17-Jun-08 4:21 
QuestionGet CPU ID & HD Serial number Pin
AlexB4716-Jun-08 21:06
AlexB4716-Jun-08 21:06 
AnswerRe: Get CPU ID & HD Serial number Pin
Vimalsoft(Pty) Ltd16-Jun-08 21:22
professionalVimalsoft(Pty) Ltd16-Jun-08 21:22 
Yes

try this

Public Class Processor_ID
    Public Function Get_CPU_ID() As String
        Try
            Dim objMOS As ManagementObjectSearcher

            Dim objMOC As Management.ManagementObjectCollection

            Dim objMO As Management.ManagementObject

            objMOS = New ManagementObjectSearcher("Select * From Win32_Processor")

            objMOC = objMOS.Get

            For Each objMO In objMOC
                MessageBox.Show("CPU ID = " & objMO("ProcessorID"))
            Next

            objMOS.Dispose()

            objMOS = Nothing

            objMO.Dispose()

            objMO = Nothing

        Catch ex As ApplicationException

            MessageBox.Show(ex.Message)

        End Try

    End Function



End Class

and Call the Function like this

in your Form

Dim strId As String
       Try
           Dim objID As New Processor_ID

           strId = objID.Get_CPU_ID()

           MessageBox.Show(strId)

       Catch ex As ApplicationException

           MessageBox.Show(ex.Message)

       End Try


And that is in vb, its easy to convert it to C#

Hope it Helps

Vuyiswa Maseko,

Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding

VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za


AnswerRe: Get CPU ID & HD Serial number Pin
sunspeed16-Jun-08 21:27
sunspeed16-Jun-08 21:27 
QuestionGetting the type of control Pin
jonhbt16-Jun-08 20:55
jonhbt16-Jun-08 20:55 
AnswerRe: Getting the type of control Pin
N a v a n e e t h16-Jun-08 21:03
N a v a n e e t h16-Jun-08 21:03 
GeneralRe: Getting the type of control Pin
jonhbt16-Jun-08 21:26
jonhbt16-Jun-08 21:26 
QuestionHow to retrieve file icon in a web application program? Pin
grewin16-Jun-08 20:15
grewin16-Jun-08 20:15 
AnswerRe: How to retrieve file icon in a web application program? Pin
sunspeed16-Jun-08 20:51
sunspeed16-Jun-08 20:51 
GeneralRe: How to retrieve file icon in a web application program? Pin
grewin16-Jun-08 22:21
grewin16-Jun-08 22:21 
Questionvote rating concept using star image in .net with c# Pin
sugunavathysubramanian16-Jun-08 20:10
sugunavathysubramanian16-Jun-08 20:10 
AnswerRe: vote rating concept using star image in .net with c# Pin
Ashfield16-Jun-08 21:17
Ashfield16-Jun-08 21:17 
QuestionTypes that own disposable fields should be disposable Pin
George_George16-Jun-08 19:58
George_George16-Jun-08 19:58 
AnswerRe: Types that own disposable fields should be disposable Pin
N a v a n e e t h16-Jun-08 20:56
N a v a n e e t h16-Jun-08 20:56 
GeneralRe: Types that own disposable fields should be disposable Pin
George_George16-Jun-08 21:04
George_George16-Jun-08 21:04 
GeneralRe: Types that own disposable fields should be disposable Pin
N a v a n e e t h16-Jun-08 21:27
N a v a n e e t h16-Jun-08 21:27 
GeneralRe: Types that own disposable fields should be disposable Pin
George_George16-Jun-08 21:40
George_George16-Jun-08 21:40 
GeneralRe: Types that own disposable fields should be disposable Pin
N a v a n e e t h16-Jun-08 22:28
N a v a n e e t h16-Jun-08 22:28 
GeneralRe: Types that own disposable fields should be disposable Pin
George_George16-Jun-08 23:08
George_George16-Jun-08 23:08 
GeneralRe: Types that own disposable fields should be disposable Pin
N a v a n e e t h16-Jun-08 23:12
N a v a n e e t h16-Jun-08 23:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.