VB6 : Associating file extensions with your app

Created 08 April 2003 00:00
  string keyName = "MyApp";
  string keyValue = "My Application";
  RegistryKey key = null;

  key = Registry.ClassesRoot.CreateSubKey(keyName);
  key.SetValue("",keyValue);
  key = key.CreateSubKey("shell");
  key = key.CreateSubKey("open");
  key = key.CreateSubKey("command");
  key.SetValue("","c:tempmy.exe %1");
            
  keyName = ".bar";	// file association you want
  keyValue = "MyApp";	// must correspond to above!!
  key = Registry.ClassesRoot.CreateSubKey(keyName);
  key.SetValue("", keyValue);