一段很有用的代码,转过来看看。
1
using Microsoft.Win32;
2
using System.Reflection;
3
AssemblyName an=new AssemblyName();
4
RegistryKey RegKey;
5
RegKey=Registry.ClassesRoot;
6
RegKey=RegKey.CreateSubKey("*\\shell\\MyApp");
7
RegKey.SetValue("","用程序打开");
8
RegKey=Registry.ClassesRoot;
9
RegKey=RegKey.CreateSubKey("*\\shell\\MyApp\\command");
10
RegKey.SetValue("",Application.ExecutablePath +" %1");
11
RegKey.Close();
Difficulty of making decision depends on what to lose not gain
























浙公网安备 33010602011771号