BLOG HIỆN ĐÃ CẬP NHẬT GIAO DIỆN HOÀN TẤT VÀ BÂY GIỜ SẼ TẬP TRUNG VÀO NHỮNG BÀI VIẾT CHIA SẼ TỐT NHẤT CHO NGƯỜI DÙNG!

[VB] How to create program permissions in Visual Basic

Hello guys, sometimes if we create an application we definitely want to protect it from hijackers. In this article I will discuss how to create an activation program by reading the processor code on the device used, then performing the encryption process.

Now go back to Form1 and add the System.Management library. Right click on the project and select Add Reference, click on the .NET Tab then scroll down until you find System.Management and click OK

Image : https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgY8M-lZn7_UKO4Vuh0ZrPGQwYFVyK2AmETBqaLmHNzZzj5FmCIJX_fSGnv_gh8zOcxxm-pzhFzmaVSfh-vrveSANgLus8ZAHjZV8ksuP3JtY6tKf1HPhTB0At8XVDcIc-6OiCfL5zFl6U/s1600/management.png

Now go into the code and declare some necessary global variables

https://pastebin.com/bvxBfGUz

Then we will read the processor code on the device we use then we display it into Textbox1.
Double-click Form1 and enter the following code in Form_Load

https://pastebin.com/KvCM4PRC

And at the same time, the program will detect whether the device used is activated or not. Otherwise, the program will display a warning message and stay on Form1, if it is, Form1 will be hidden and Form2 will appear.

https://pastebin.com/M3yTXNkd

NOTE

some additional code above serves for the encoding of the processor code, then stored in the hasilenkripi variable.
then, the value of the hasilenkripsi variable will be stored in the Windows Registry Editor (Regedit) in the HKEY_CURRENT_USER folder.

Now, double-click Button 2 and enter the following code, so that the user can skip the activation process and enter Form2 but within a certain time.

https://pastebin.com/uUw9PTQn

Then double click Button 1 and enter the following code, to match whether the activation code entered in Textbox2 is equal to the value of hasilenkripsi variable. If appropriate, then Form1 will be hidden and Form2 will appear without time limit, otherwise it will display a warning message.

https://pastebin.com/z1sZEZzU

And finally, open Form2 and change the Timer1 properties to Enabled : True, Then double click on Timer1 and enter the following code.

https://pastebin.com/PmH3UWhU

NOTE

The above code works if Timer1 is enabled: True then Form2 can only appear for 5 seconds, If Timer1 is enabled: False then Form2 will appear without time limit.
You can change 5 seconds to 10 seconds (for example) by changing 50 to 100.

VIDEO DEMO : https://youtu.be/Ku-xoChi8M8

Good luck

3 comments

  1. Không hiểu lắm :s
  2. haha, nice code, every things settings PERMISSIONS all men now. contact me @gunjiz_mix
    1. hi me using telegram?
👉 Nội dung liên quan: Nhận xét cần tập trung vào chủ đề của bài viết hoặc giao diện đang chia sẻ.

👉 Văn hóa ứng xử: Không sử dụng ngôn từ tục tĩu, xúc phạm, phân biệt chủng tộc hoặc kích động.

👉 Không Spam/Quảng cáo: Nghiêm cấm chèn link spam, quảng cáo dịch vụ/sản phẩm không liên quan hoặc rác điện tử.

👉 Tôn trọng quyền riêng tư: Không chia sẻ thông tin cá nhân của người khác (doxxing).
Ngôn ngữ: Khuyến khích tiếng Việt có dấu, rõ ràng.

👉 Quyền quản trị: Quản trị viên có quyền xóa hoặc chỉnh sửa bình luận vi phạm mà không cần báo trước.
Hung Pro VN © 2015
Tôi Lê Hùng, chia sẽ kiến thức và tư duy sáng tạo của bản thân mỗi ngày cho cộng đồng Internet Việt Nam hiện tại.
Developed by Jago Desain