n C#, you can open an application as an administrator on a Windows 10 machine by modifying the application manifest file.
Here's an example:
1- Right-click on your project in Visual Studio and select "Add" -> "New Item".
2- Select "Application Manifest File" and click "Add".
3- Open the manifest file (app.manifest) and change the requestedExecutionLevel element to the following:
the ProcessStartInfo class is used to specify the application to launch (FileName) and the verb to use (Verb). The Verb property is set to "runas" to indicate that the application should be run as an administrator. The Process.Start() method is then used to launch the application with the specified settings.
Note that modifying the application manifest to require administrator privileges may cause compatibility issues or other unexpected behavior, and that you should use caution and appropriate security measures when modifying system-level functionality. Also, note that launching an application as an administrator may require administrator privileges or other system permissions, and that you should use caution and appropriate security measures when working with system-level functions.