Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Softproman
Copy link

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

- Network adapter does not restart
- The network adapter always says that the MAC Address was changed even if there was an error
@SecHex
Copy link
Owner

SecHex commented Mar 3, 2024

Please write the comments in English.

@totorocodesoften
Copy link

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

@Softproman
Copy link
Author

Softproman commented Mar 5, 2024

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.

@SecHex
Copy link
Owner

SecHex commented Mar 7, 2024

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.

@Softproman
Copy link
Author

Softproman commented Mar 7, 2024

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 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants