you can change the IP address of a Windows 10 machine using the System.Management namespace and the Win32_NetworkAdapterConfiguration WMI class.
the SetIpAddress() method takes three string arguments: adapterName, which is the name of the network adapter to configure, ipAddress, which is the desired IP address, and subnetMask, which is the desired subnet mask. The ManagementClass is used to obtain a collection of ManagementObject instances that represent the network adapter configurations on the machine. The foreach loop iterates over these instances and selects the one that corresponds to the specified adapter name and is currently enabled (IPEnabled property is true). The GetMethodParameters() method is used to obtain a ManagementBaseObject that represents the EnableStatic method of the Win32_NetworkAdapterConfiguration class, and the IPAddress and SubnetMask properties are set to the desired values. Finally, the InvokeMethod() method is used to invoke the EnableStatic method with the specified parameters.
The resulting output is a message indicating that the IP address has been changed successfully. Note that changing the IP address programmatically may require administrator privileges or other system permissions, and that you should use caution and appropriate security measures when working with system-level functions.