1. Create an app. manifest to write the configuration content
<? Xml version = "1.0" encoding = "UTF-8"?> <Asmv1: assembly manifestVersion = "1.0" xmlns = "urn: schemas-microsoft-com: asm. v1 "xmlns: asmv1 =" urn: schemas-microsoft-com: asm. v1 "xmlns: asmv2 =" urn: schemas-microsoft-com: asm. v2 "xmlns: xsi =" http://www.w3.org/2001/XMLSchema-instance "> <assemblyIdentity version =" 1.0.0.0 "name =" MyApplication. app "/> <trustInfo xmlns =" urn: schemas-microsoft-com: asm. v2 "> <security> <requestedPrivileges xmlns =" urn: schemas-micro Soft-com: asm. v3 "> <! -- UAC configuration option if you want to change the Windows User Account Control level, replace the requestedExecutionLevel node with one of the following nodes. <Strong level = "asInvoker" uiAccess = "false"/> <requestedExecutionLevel = "requireAdministrator" uiAccess = "false"/> <requestedExecutionLevel = "highestAvailable" uiAccess = "false" /> specifying the requestedExecutionLevel node will disable file and Registry virtualization. If you want to use file and Registry virtualization for backward compatibility, delete the requestedExecutionLevel node. --> <RequestedExecutionLevel level = "requireAdministrator" uiAccess = "false"/> </requestedPrivileges> </security> </trustInfo> <compatibility xmlns = "urn: schemas-microsoft-com: compatibility. v1 "> <application> <! -- List of all Windows versions designed for this application. Windows automatically selects the most compatible environment. --> <! -- If the application is designed to use Windows 7, uncomment the following supportedOS node --> <! -- <SupportedOS Id = "{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/> --> </application> </compatibility> <! -- Enable the Windows public control and dialog box topic (Windows XP and later) --> <! -- <Dependency> <dependentAssembly> <assemblyIdentity type = "win32" name = "Microsoft. windows. common-Controls "version =" 6.0.0.0 "processorArchitecture =" * "publicKeyToken =" 6595b64144ccf1df "language =" * "/> </dependentAssembly> </dependency> --> </asmv1: assembly>
2. Modify the level in requestedExecutionLevel
3. Select an application item in the project properties, and then select the added file app. manifest in the list.
4. recompile the program
5. Run the program in bin and you will see the icon under it.