Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» ~=?{The future is here, TastyExploit officially open to the public}?=~
Tue Mar 02, 2010 11:00 pm by Dami

» My first aa script
Tue Mar 02, 2010 7:00 am by wafflemaster

» the real story behind Maverin
Tue Mar 02, 2010 1:33 am by SoundOfDeat

» Random spam
Mon Mar 01, 2010 11:52 pm by Danny1994

» [Request] EMS v56 Exe
Mon Mar 01, 2010 12:39 am by Dami

» [Blacklist] NX-Trading Blacklist.
Mon Mar 01, 2010 12:38 am by Danny1994

» I have a question regarding the meso farmer
Sat Feb 27, 2010 10:30 pm by Dami

» What are you listening to now?
Sat Feb 27, 2010 7:57 pm by Noname111111

» Video(s) Of The Day
Sat Feb 27, 2010 7:37 pm by Noname111111

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search
Affiliates
free forum
 



[C#]Making a program a files default editor

Go down

[C#]Making a program a files default editor

Post by Dami on Fri Oct 30, 2009 3:58 am

By PeeHPee

Well, first, to start off... this adds new registery keys so it can't be converted to linux friendly C# so here we go

Code:
public void DefaultEditor()
{
RegistryKey RegKey = Registry.ClassesRoot.CreateSubKey(".tut");
RegKey.SetValue("", "C Sharp Tutorial Files");
RegKey.Close();
RegKey = Registry.ClassesRoot.CreateSubKey("C Sharp Tutorial Files");
RegKey.SetValue("", "C Sharp Tutorial Files");
RegKey.Close();
RegKey = Registry.ClassesRoot.CreateSubKey("C Sharp Tutorial Files" + "\\" + "Shell"
                            + "\\" + "Open");
    RegKey = RegKey.CreateSubKey("Command");
    //Set the application for handling the open command and pass
    //the file path as a parameter
    RegKey.SetValue("",
        "\"" + Application.ExecutablePath + "\"" + " \"%L\"");
    RegKey.Close();
}

That above code will just make it open with your project, if you want to assosciate an icon with it use this;
Code:
 RegKey = Registry.ClassesRoot.CreateSubKey("C Sharp Tutorial Files" + "\\"
        + "DefaultIcon");
    RegKey.SetValue("", Application.StartupPath+"\\icon.ico");
    RegKey.Close();
avatar
Dami
Dragon
Dragon

Posts : 1414
Join date : 2009-08-10
Age : 29
Location : Finland

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum