반응형
public void SetAssociationIcon(string fileExtention, string progid, string iconFullPath)
{
try
{
fileExtention = "." + fileExtention;
Registry.ClassesRoot.CreateSubKey(fileExtention).SetValue("", progid);
Registry.ClassesRoot.CreateSubKey(progid).CreateSubKey("DefaultIcon").SetValue("", iconFullPath);
IsNeedRefresh = true;
}
catch (Exception ex)
{
throw ex;
}
}
public void SetAssociationExe(string progid, string excuteProgramFullPath)
{
try
{
excuteProgramFullPath = excuteProgramFullPath + " \"%1\"";
Registry.ClassesRoot.CreateSubKey(progid).CreateSubKey("shell")
.CreateSubKey("open")
.CreateSubKey("command")
.SetValue("", excuteProgramFullPath);
}
catch (Exception ex)
{
throw ex;
}
}
'Programing > C# ' 카테고리의 다른 글
C# Properties.Settings 에서 생성한 값의 저장경로[user.config] (0) | 2014.08.01 |
---|---|
Tabless TabControl(탭해더 없는 탭페이지) 만들기 (0) | 2014.06.16 |
레지스트리 파일 아이콘 변경후 리부팅 없이 적용 (0) | 2014.06.11 |
showWindow 에서 TopMost로 폼창 띄우기 (0) | 2014.04.21 |
Custom Button for Image (0) | 2014.04.03 |