SecHex-Spoofy icon indicating copy to clipboard operation
SecHex-Spoofy copied to clipboard

Solved: - Network adapter does not restart - The network adapter always says that the MAC Address was changed even if there was an error

Open Softproman opened this issue 1 year ago • 5 comments

  • Network adapter does not restart
  • The network adapter always says that the MAC Address was changed even if there was an error

Softproman avatar Mar 03 '24 18:03 Softproman

Please write the comments in English.

SecHex avatar Mar 03 '24 19:03 SecHex

Hello! Thanks for your contribution, did you write your NetworkAdapter.cs yourself or did you get it from some online ressource ? Just to know for debugging purposes 🙂 With best regards

totorocodesoften avatar Mar 05 '24 10:03 totorocodesoften

Hi, NetworkAdapter.cs was generated automatically by mgmtclassgen.exe, a VS utility (since my VS is in Spanish, that's why the source comments are in Spanish) to generate a wrapper class around the WMI Win32_NetworkAdapter class.

Softproman avatar Mar 05 '24 20:03 Softproman

Hi, NetworkAdapter.cs was generated automatically by mgmtclassgen.exe, a VS utility (since my VS is in Spanish, that's why the source comments are in Spanish) to generate a wrapper class around the WMI Win32_NetworkAdapter class.

Would it be possible to condense the .cs file and merge all functions into the main file? It wouldn't make much sense to create a new .cs file for a single function.

SecHex avatar Mar 07 '24 18:03 SecHex

Hi, NetworkAdapter.cs was generated automatically by mgmtclassgen.exe, a VS utility (since my VS is in Spanish, that's why the source comments are in Spanish) to generate a wrapper class around the WMI Win32_NetworkAdapter class.

Would it be possible to condense the .cs file and merge all functions into the main file? It wouldn't make much sense to create a new .cs file for a single function.

Yes, anything is possible :-) but I wouldn't do it. I would try to leave the functionality separate because they are different things. NetworkAdapter.cs is a wrapper over the Win32_NetworkAdapter WMI class and therefore can do more than just reset the network adapter. And NetwordkAdapterUtils.cs is a class with three functions, and the class can be extended with more functionality as needed without having to be mixed with the WMI wrapper (it's easier to see what a 40-line class does than a 400-line class :-P )

Softproman avatar Mar 07 '24 21:03 Softproman