23-03-21, 03:55 AM
Imports System.Management
Imports Microsoft.Win32
Imports System.Security.AccessControl
Public Class Form1
'Public Sub Get_Info()
' Dim cmicWmi As New System.Management.ManagementObjectSearcher("SELECT * FROM Win32_DiskDrive")
' Dim diskId As String 'Digital ID
' Dim diskSerialNumber As String 'This we will call it the serial number for the time being.
' Dim diskModel As String 'serial number
' For Each cmicWmiObj As ManagementObject In cmicWmi.Get
' diskId = cmicWmiObj("signature")
' diskSerialNumber = cmicWmiObj("serialnumber")
' diskModel = cmicWmiObj("Model")
' Next
'End Sub
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
TxtWnd.Text = My.Computer.Info.OSFullName
TxtMname.Text = System.Environment.MachineName
TxtLang.Text = My.Computer.Info.InstalledUICulture.EnglishName
Dim cmicWmi As New System.Management.ManagementObjectSearcher("SELECT * FROM Win32_DiskDrive")
Dim diskId As String 'Digital ID
Dim diskSerialNumber As String 'This we will call it the serial number for the time being.
Dim diskModel As String 'serial number
For Each cmicWmiObj As ManagementObject In cmicWmi.Get
diskId = cmicWmiObj("signature")
diskSerialNumber = cmicWmiObj("serialnumber")
diskModel = cmicWmiObj("Model")
Next
TextBox1.Text = diskSerialNumber
TextBox2.Text = diskId
TextBox4.Text = Val(TextBox2.Text) * 13 + 1225 - 1650
TextBox4.Text = TextBox4.Text * 17
End Sub
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
If TextBox3.Text = TextBox4.Text Then
MsgBox("تمت عملية تفعيل البرنامج بنجاح")
Dim x As String
x = TextBox3.Text
Dim Activekey As RegistryKey
Activekey = Registry.LocalMachine.OpenSubKey("SOFTWARE", True)
Activekey = Registry.LocalMachine.OpenSubKey("SOFTWARE\FoxSoftware", True)
If Activekey Is Nothing Then
Activekey = Registry.LocalMachine.OpenSubKey("SOFTWARE", True)
Activekey.CreateSubKey("FoxSoftware")
Activekey = Registry.LocalMachine.OpenSubKey("SOFTWARE\FoxSoftware", True)
Activekey.SetValue("System_key", x)
Activekey.Close()
End If
Else
MsgBox("رقم التفعيل الذي ادخلته غير صحيح الرجاء مراجعة قسم المبيعات")
Application.Exit()
End If
End Sub
End Class
Imports Microsoft.Win32
Imports System.Security.AccessControl
Public Class Form1
'Public Sub Get_Info()
' Dim cmicWmi As New System.Management.ManagementObjectSearcher("SELECT * FROM Win32_DiskDrive")
' Dim diskId As String 'Digital ID
' Dim diskSerialNumber As String 'This we will call it the serial number for the time being.
' Dim diskModel As String 'serial number
' For Each cmicWmiObj As ManagementObject In cmicWmi.Get
' diskId = cmicWmiObj("signature")
' diskSerialNumber = cmicWmiObj("serialnumber")
' diskModel = cmicWmiObj("Model")
' Next
'End Sub
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
TxtWnd.Text = My.Computer.Info.OSFullName
TxtMname.Text = System.Environment.MachineName
TxtLang.Text = My.Computer.Info.InstalledUICulture.EnglishName
Dim cmicWmi As New System.Management.ManagementObjectSearcher("SELECT * FROM Win32_DiskDrive")
Dim diskId As String 'Digital ID
Dim diskSerialNumber As String 'This we will call it the serial number for the time being.
Dim diskModel As String 'serial number
For Each cmicWmiObj As ManagementObject In cmicWmi.Get
diskId = cmicWmiObj("signature")
diskSerialNumber = cmicWmiObj("serialnumber")
diskModel = cmicWmiObj("Model")
Next
TextBox1.Text = diskSerialNumber
TextBox2.Text = diskId
TextBox4.Text = Val(TextBox2.Text) * 13 + 1225 - 1650
TextBox4.Text = TextBox4.Text * 17
End Sub
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
If TextBox3.Text = TextBox4.Text Then
MsgBox("تمت عملية تفعيل البرنامج بنجاح")
Dim x As String
x = TextBox3.Text
Dim Activekey As RegistryKey
Activekey = Registry.LocalMachine.OpenSubKey("SOFTWARE", True)
Activekey = Registry.LocalMachine.OpenSubKey("SOFTWARE\FoxSoftware", True)
If Activekey Is Nothing Then
Activekey = Registry.LocalMachine.OpenSubKey("SOFTWARE", True)
Activekey.CreateSubKey("FoxSoftware")
Activekey = Registry.LocalMachine.OpenSubKey("SOFTWARE\FoxSoftware", True)
Activekey.SetValue("System_key", x)
Activekey.Close()
End If
Else
MsgBox("رقم التفعيل الذي ادخلته غير صحيح الرجاء مراجعة قسم المبيعات")
Application.Exit()
End If
End Sub
End Class