⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 class1.cs

📁 C#150例
💻 CS
字号:
using System;
using Microsoft.Win32;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Diagnostics;

namespace Example102_修改系统的右键菜单
{
	/// <summary>
	/// Class1 的摘要说明。
	/// </summary>
	class Class1
	{
		/// <summary>
		/// 应用程序的主入口点。
		/// </summary>
		[STAThread]
		static void Main(string[] args)
		{
			//
			// TODO: 在此处添加代码以启动应用程序
			//
			
			if(args.Length>0)
			{
				Console.Write(args[0]);
				Console.Read();
			}
			else
			{
				Process p=Process.GetCurrentProcess();
				

				AssemblyName an=new AssemblyName();
				RegistryKey RegKey;
				RegKey=Registry.ClassesRoot;
				RegKey=RegKey.CreateSubKey("*\\shell\\MyApp");
				RegKey.SetValue("","What is this?");
				RegKey=Registry.ClassesRoot;
				RegKey=RegKey.CreateSubKey("*\\shell\\MyApp\\command");
				RegKey.SetValue("",p.MainWindowTitle+" %1");
				RegKey.Close();
			}
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -