반응형
public void SetAssociationIcon(string fileExtention, string progid, string iconFullPath)
{
	fileExtention = "." + fileExtention;
	Registry.ClassesRoot.CreateSubKey(fileExtention).SetValue("", progid);
	Registry.ClassesRoot.CreateSubKey(progid).CreateSubKey("DefaultIcon").SetValue("", iconFullPath);
			IsNeedRefresh = true;
}
 
public void SetAssociationExe(string progid, string excuteProgramFullPath)
{
	excuteProgramFullPath = excuteProgramFullPath + " \"%1\"";

	Registry.ClassesRoot.CreateSubKey(progid).CreateSubKey("shell")
											.CreateSubKey("open")
											.CreateSubKey("command")
											.SetValue("", excuteProgramFullPath);
}
반응형

+ Recent posts