Git Product home page Git Product logo

resourcelib's Introduction

ResourceLib C# File Resource Management Library

Build status NuGet NuGet

There are several good articles about reading and writing resources from/to a compiled binary. Most focus on retrieving module version information and modifying version information, mostly in C++. Some detail the same operations for cursors, icons or dialog resources. There is, however, no single .NET library to retrieve and save any type of resources, or any library to edit version resources specifically.

This project is a framework that enumerates resources and implements both read and write of the file version VS_VERSIONINFO, string resources such as company, copyright and product information, RT_GROUP_ICON and RT_ICON, RT_CURSOR, RT_BITMAP, RT_MENU, RT_DIALOG, RT_STRING, RT_ACCELERATOR, RT_FONT and RT_FONTDIR and RT_MANIFEST resources. It's unit-tested and well documented.

Installation

ResourceLib is distributed as a NuGet package:

PM> Install-Package Vestris.ResourceLib

Getting Started

In your project add a reference to Vestris.ResourceLib.dll and a namespace reference.

using Vestris.ResourceLib;

The following example demonstrates enumerating resources by resource type. From the sample atl.dll in the Windows system directory, you will typically get the following resources: MUI, REGISTRY, TYPELIB, and RT_VERSION resource.

string filename = Path.Combine(Environment.SystemDirectory, "atl.dll");
using (ResourceInfo vi = new ResourceInfo())
{
    vi.Load(filename);
    foreach (ResourceId id in vi.ResourceTypes)
    {
        Console.WriteLine(id);
        foreach (Resource resource in vi.Resources[id])
        {
            Console.WriteLine("{0} ({1}) - {2} byte(s)",
                resource.Name, resource.Language, resource.Size);
        }
    }
}

Reference

Contributing

Fork the project on Github, commit changes to your local repository, push changes to your fork, and make a pull request. Bonus points for topic branches. Also see Setting up a Development Environment.

Copyright and License

Copyright (c) Daniel Doubrovkine, Vestris Inc., 2008-2016.

This project is licensed under the MIT license.

resourcelib's People

Contributors

yazgoo avatar thoemmi avatar dblock avatar hakito avatar redwyre avatar hypersw avatar fantasticfiasco avatar jairbubbles avatar icnocop avatar dwmkerr avatar ljani avatar maxxor avatar xiangsxuan avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.