Click here to Skip to main content
12,635,149 members (24,805 online)
Click here to Skip to main content

Stats

220.9K views
9.2K downloads
135 bookmarked
Posted

System File Association

, 16 Mar 2007
This article describes the use of several custom C# classes that can be used to create, view, edit and delete Windows file associations.
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>8.0.50727</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{9085929F-58D2-4D4F-8E81-B64424B9EAB8}</ProjectGuid>
    <OutputType>WinExe</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>BrendanGrant.Helpers.FileAssociation.Example</RootNamespace>
    <AssemblyName>FileAssociationExample</AssemblyName>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Deployment" />
    <Reference Include="System.Drawing" />
    <Reference Include="System.Windows.Forms" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="AddOpenWithDialog.cs">
      <SubType>Form</SubType>
    </Compile>
    <Compile Include="AddOpenWithDialog.Designer.cs">
      <DependentUpon>AddOpenWithDialog.cs</DependentUpon>
    </Compile>
    <Compile Include="AddVerbDialog.cs">
      <SubType>Form</SubType>
    </Compile>
    <Compile Include="AddVerbDialog.Designer.cs">
      <DependentUpon>AddVerbDialog.cs</DependentUpon>
    </Compile>
    <Compile Include="NewExtensionDialog.cs">
      <SubType>Form</SubType>
    </Compile>
    <Compile Include="NewExtensionDialog.Designer.cs">
      <DependentUpon>NewExtensionDialog.cs</DependentUpon>
    </Compile>
    <Compile Include="NewProgramAssociationDialog.cs">
      <SubType>Form</SubType>
    </Compile>
    <Compile Include="NewProgramAssociationDialog.Designer.cs">
      <DependentUpon>NewProgramAssociationDialog.cs</DependentUpon>
    </Compile>
    <Compile Include="Program.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
    <EmbeddedResource Include="AddOpenWithDialog.resx">
      <DependentUpon>AddOpenWithDialog.cs</DependentUpon>
      <SubType>Designer</SubType>
    </EmbeddedResource>
    <EmbeddedResource Include="AddVerbDialog.resx">
      <DependentUpon>AddVerbDialog.cs</DependentUpon>
      <SubType>Designer</SubType>
    </EmbeddedResource>
    <EmbeddedResource Include="NewExtensionDialog.resx">
      <DependentUpon>NewExtensionDialog.cs</DependentUpon>
      <SubType>Designer</SubType>
    </EmbeddedResource>
    <EmbeddedResource Include="NewProgramAssociationDialog.resx">
      <DependentUpon>NewProgramAssociationDialog.cs</DependentUpon>
      <SubType>Designer</SubType>
    </EmbeddedResource>
    <EmbeddedResource Include="Properties\Resources.resx">
      <Generator>ResXFileCodeGenerator</Generator>
      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
      <SubType>Designer</SubType>
    </EmbeddedResource>
    <EmbeddedResource Include="AssociationGUIForm.resx">
      <DependentUpon>AssociationGUIForm.cs</DependentUpon>
      <SubType>Designer</SubType>
    </EmbeddedResource>
    <Compile Include="Properties\Resources.Designer.cs">
      <AutoGen>True</AutoGen>
      <DependentUpon>Resources.resx</DependentUpon>
      <DesignTime>True</DesignTime>
    </Compile>
    <None Include="Properties\Settings.settings">
      <Generator>SettingsSingleFileGenerator</Generator>
      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
    </None>
    <Compile Include="Properties\Settings.Designer.cs">
      <AutoGen>True</AutoGen>
      <DependentUpon>Settings.settings</DependentUpon>
      <DesignTimeSharedInput>True</DesignTimeSharedInput>
    </Compile>
    <Compile Include="AssociationGUIForm.cs">
      <SubType>Form</SubType>
    </Compile>
    <Compile Include="AssociationGUIForm.Designer.cs">
      <DependentUpon>AssociationGUIForm.cs</DependentUpon>
    </Compile>
  </ItemGroup>
  <ItemGroup>
    <ProjectReference Include="..\FileAssociation\FileAssociation.csproj">
      <Project>{E2EDE3ED-1E9E-46D9-903E-1A8FEB4B2371}</Project>
      <Name>FileAssociation</Name>
    </ProjectReference>
  </ItemGroup>
  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Brendan Grant
Web Developer
United States United States
No Biography provided

You may also be interested in...

Pro
| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.161208.2 | Last Updated 16 Mar 2007
Article Copyright 2007 by Brendan Grant
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid