giovedì 9 luglio 2009

Get the version information of an extern assembly

We have more ways to get the information of an assembly, the most two I use are:
  1. Only for .NET assembly
    System.Reflection.Assembly AssemblyFileInfo = System.Reflection.Assembly.Load(FileAppPath);
    Console.WriteLine (AssemblyFileInfo.GetName().Version);

  2. For all .NET and native assembly
    FileVersionInfo AssemblyFileVersion = System.Diagnostics.FileVersionInfo.GetVersionInfo(FileAppPath);

martedì 9 giugno 2009

Application Path

Sometime I need to retrieve the application path, here I add the four methods I use frequently.

  1. The simple way through windows forms:
    String sAppPath1 = Application.StartupPath;
  2. From the binary over reflection:
    String sAppPath2 = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase );
  3. Using the file informations:
    FileInfo executableFileInfo = new FileInfo (Application.ExecutablePath);
    String sAppPath3 = executableFileInfo.DirectoryName;
  4. When my program is started from another:
Happy coding.

martedì 17 marzo 2009

Creating attractive UIs on Windows Mobile devices

Next week Alex Yakhnin will show us how to customize built-in controls that come with .NET CF, such as TextBox, DataGrid, ListView etc...

The first webcast of the series was great, this second will be better and more interesting. Stay tuned.

venerdì 9 gennaio 2009

iPod touch UI

I continue my journey in the fascinating world of mobile with a new article on TheCodeProject iPod touch UI[^].

Here you can see a new way to work with Alpha blending and a way to work with WMP OCX on mobile. The article focus on
  • C#
  • CF .NET
  • Resolution-aware and Orientation-aware
  • Dynamic graphic text resize
  • Mouse gesture
  • Intercepting button
  • Work with Windows Media Player OCX on Windows Mobile.

I hope you enjoy during the reading like me during the develop.