昨天拿C#写了个简单的密保卡程序(Console的,偷懒了一下 哈哈),实现了随机生成5x5矩阵卡、转换为字符串、从字符串读取矩阵卡以及简单验证的功能。不过我写的比较草率,代码结构不是很好,也没有体现OOP的思想,这几天有空会重构一下。先把代码发出来:public class MatrixCardManager
{
public static int[,] ReadMatrixCardFromString(string matrixStr)
{
int[,] arr1 = new int[5, 5];
int[] tempArr = new int[25];
int k = 0;
string[] tempArrStr = …
Recently, I saw an exam system that has a feature to monitor the process. As soon as prohibited software such as Communicator.exe is found, the process is immediately killed and reported to the server. I looked into it a little bit, and this feature is actually quite simple to implement. It is to use ManagementObjectSearcher to get a list of processes, then put them in a Collection, and then you can do it according to your own logic. Here's an example: get a list of processes, create a list of "banned" processes, find and kill processes. Note that you need to add a reference to System.Management in your project first.