小编use*_*649的帖子

如何通过代码欺骗MAC地址

我正在尝试欺骗执行程序的计算机的MAC地址.现在我通过cmd使用'getmac'命令获取机器的当前MAC地址,然后我想通过'RegistryKey'类(windows.system32)更改它.

问题是我不知道传递给OpenSubKey方法的字符串.

例如,这是使用注册表项读取读取当前MAC的方法:

 private string readMAC()
    {
        RegistryKey rkey;
        string MAC;
        rkey = Registry.LocalMachine.OpenSubKey("SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002BE10318}\\0012", true); //--->this is the string to change 
        MAC = (string)rkey.GetValue("NetworkAddress");
        rkey.Close();
        return MAC;
    }
Run Code Online (Sandbox Code Playgroud)

c# mac-address

6
推荐指数
2
解决办法
7483
查看次数

使用 cmd.exe 执行命令时出现问题

我在执行此代码时遇到问题:

Process arp = new Process();
arp.StartInfo.UseShellExecute = false;
arp.StartInfo.RedirectStandardOutput = true;
arp.StartInfo.FileName = "C://Windows//System32//cmd.exe";
arp.StartInfo.Arguments = "arp -a";
arp.StartInfo.RedirectStandardOutput = true;
arp.Start();
arp.WaitForExit();
string output = arp.StandardOutput.ReadToEnd();
MessageBox.Show(output);
Run Code Online (Sandbox Code Playgroud)

该程序应该将 arp-a 的输出放入字符串输出中,但它却给了我这个:

Microsoft Windows [版本 6.1.7601]\r\n版权所有 (c) 2009 Microsoft Corporation。保留所有权利。\r\n\r\nC:\Users\user01\documents\visual studio 2012\Projects\freehotspotexploiter\freehotspotexploiter\bin\Debug>

有人知道如何修复它吗?

c# cmd

1
推荐指数
1
解决办法
696
查看次数

标签 统计

c# ×2

cmd ×1

mac-address ×1