Various Tools
Being a Software Developer, I tend to write quite a few small Utilities for my personal or work use, and I'm sharing some of them here.
Misc Utils Library
Visit https://github.com/mstum/mstum.utils for a .net Utility Library containing various classes, extension methods and other utility functions.
MakeDDF
makeddf is intended to make building of .ddf files for makecab.exe easier. It's main target audience is for Sharepoint Developers who need to create .wsp Files, which are just CAB files with a different extension.
It will check a given directory and add all files and subdirectories to a .ddf file, which you can then pass to makecab.exe /f.
Download: MakeDDF 1.0.1 (the only change between 1.0.0 and 1.0.1 is the removal of the dependency on CSharpOptParse.dll)
(Requires Microsoft .net Framework 2.0)
Misc. Code Samples
Here are some Code Samples for various uses. They are licensed under WTFPL, so feel free to use them for whatever purpose you want.
C# IniFile Class
Download: IniFile Class, Version 1, 2009-08-15
A class to Load/Save .ini files. For more information, see here.
.net CommandLine Parser
Download: CommandLine Parser Class, Version 1, 2008-06-22
A really simple CommandLine Parser Class for .net 2.0 and above, written in C#. This takes your string[] args and returns a Dictionary<string, List<string>>, where the Key are the arguments (everything that starts with a / or -) and the List contains all the parameters that where passed to the argument (value maybe null!).
For example, this command line:
mytool.exe blapp /alpha /beta bla /Beta omega /test "bluppa blappa blip" /delta blub /delta zeta kappa
leads to a Dictionary like this:
Key: string.Empty
Values: List<string> with 2 Entries: "blapp" and "kappa"Key: alpha
Values: nullKey: beta
Values: List<string> with 2 Entries: "bla" and "omega"Key: test
Values: List<string> with 1 Entry: "bluppa blappa blip"Key: delta
Values: List<string> with 2 Entries: "blub" and "zeta"
Just keep in mind that the Value may be null, in the case of "/alpha". So to see if "alpha" was set, you can use a simple result.ContainsKey("alpha").
The Function accepts two optional Parameters: "IgnoreArgumentCase" can be set to false to treat "/beta" and "/Beta" as two different arguments, and "AllowMultipleArguments" controls constructs like "/delta zeta kappa". Per default, only "zeta" is a parameter to "/delta", wheras "kappa" goes into the string.Empty key. Set "AllowMultipleArguments" to true and "delta" will catch both "kappa" and "zeta". Of couse, enclosing your parameters in double quotes (like with /test above) will treat everything inside the quotes as a single parameter.
The string.Empty key in the results contains all those parameters that could not be assigned to any argument, for example "blapp" (which is set before any argument) and "kappa" which is assigned to string.Empty because "AllowMultipleArguments" is false by default.