FileAssociation/AssociationManager.cs
/// <summary>
/// Associates an already existing program id with a list of extensions.
/// </summary>
/// <param name="progId">The program id to associate extensions with.</param>
/// <param name="extensions">String array of extensions to associate with program id.</param>
Associates an already existing program id with a list of extensions.
Associates an already existing program id with a list of extensions .
public void Associate(string progId, params string[] extensions)
      {
         foreach (string s in extensions)
         {
            FileAssociationInfo fai = new FileAssociationInfo(s);
            if (!fai.Exists)
               fai.Create(progId);
            fai.ProgID = progId;
         }
      }
public void Associate ( string progId , params string [ ] extensions ) { foreach ( string s in extensions ) { FileAssociationInfo fai = new FileAssociationInfo ( s ) ; if ( ! fai . Exists ) fai . Create ( progId ) ; fai . ProgID = progId ; } }
Associates an already existing program id with a list of extensions.
Associates an already existing program id with a list of extensions .
progId
string
The program id to associate extensions with.
The program id to associate extensions with .
extensions
String array of extensions to associate with program id.
String array of extensions to associate with program id .