The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,862 other subscribers

Archive for the ‘Visual Studio and tools’ Category

C#/.NET – GetExecutablePath – borrowed a bit from the Delphi 2006 RTL

Posted by jpluimers on 2009/07/15

Somehow, at every client I need a function like GetExecutablePath.

Maybe you do too, so here is the code that I adapted a long time ago from the Delphi 2006 RTL:

using System;
using System.Diagnostics;
using System.Reflection;
namespace bo.Reflection
{
    public class AssemblyHelper
    {

        public static string GetExecutablePath()
        {
            // borrowed from D2006\source\dotNet\rtl\Borland.Delphi.System.pas function ParamStr():
            string result;
            Assembly entryAssembly = Assembly.GetEntryAssembly();
            if (null != entryAssembly)
            {
                result = entryAssembly.Location;
            }
            else
            {
                Process currentProcess = Process.GetCurrentProcess();
                ProcessModule mainModule = currentProcess.MainModule;
                result = mainModule.FileName;
            }
            return result;
        }
    }
}

Enjoy :-)

–jeroen

Posted in .NET, C#, C# 2.0, C# 3.0, Delphi, Development, Software Development, Visual Studio and tools | 2 Comments »

yet another update to TFS 2008 Folder Comparison Filter for both C# and Delphi projects « The Wiert Corner – Jeroen Pluimers’ irregular stream of Wiert stuff

Posted by jpluimers on 2009/07/09

Here is another update for the TFS 2008 Folder Comparison Filter for both C# and Delphi projects:

Exclude .bpl, .dcp, log and .lck files.

So then the search filter becomes this:

!*.pdb;!*.obj;!*.dll;!*.exe;!*.res;!*.resources;!*.cache;!*.ilk;!*.ncb;!obj;!objd;!bin;!lib;!*.local;!*.identcache;!*.dcu;!__history;!*.dsk;!*.~*;!*.stat;!*.drc;!*.map;!*.csproj.user;!*.vbproj.user;!*.csproj.webinfo;!*.vbproj.webinfo;!*.suo;!*.bpl;!*.dcp;!*.log;!*.lck

(Note: this all goes on one line; your web-browser probably wraps this over multiple lines, so you might need to undo that wrapping before pasting it in to TFS).

Have fun with it!

–jeroen

Posted in .NET, Delphi, Development, Software Development, Source Code Management, TFS (Team Foundation System), Visual Studio and tools | Leave a Comment »

update to TFS 2008 Folder Comparison Filter for both C# and Delphi projects « The Wiert Corner – Jeroen Pluimers’ irregular stream of Wiert stuff

Posted by jpluimers on 2009/06/09

Last month I wrote about the TFS 2008 Folder Comparison Filter for both C# and Delphi projects; here is an update:

If you enable the generation of MAP files during compilation, you might not want to include them in your search filter.

Also, the .suo, .user and .webinfo extensions were missing (for an explanation of Visual Studio file extensions, see here and here), so then the search filter becomes this:

!*.pdb;!*.obj;!*.dll;!*.exe;!*.res;!*.resources;!*.cache;!*.ilk;!*.ncb;!obj\;!objd\;!bin\;!lib\;!*.local;!*.identcache;!*.dcu;!__history;!*.dsk;!*.~*;!*.stat;!*.drc;!*.map;!*.csproj.user;!*.vbproj.user;!*.csproj.webinfo;!*.vbproj.webinfo;!*.suo

Have fun with it!

–jeroen

Posted in .NET, C#, Delphi, Development, Prism, Software Development, Source Code Management, TFS (Team Foundation System), Visual Studio and tools | Leave a Comment »

Edited: Conferences, seminars and other public appearances « The Wiert Corner

Posted by jpluimers on 2009/05/15

I have edited the Conferences, seminars and other public appearances/ page and extended the list of conferences I have attended in the past including many sessions.

Topics covered in these sessions have been C#, Delphi, Databases, Linux, Kylix, debugging, Compact Framework, and much much more.

Let me know which sessions you’d like to see online first.

The list is far from complete, but it is another step into getting the list more accurate.

–jeroen

Posted in .NET, C#, C# 2.0, Component Development, Conferences, Database Development, Delphi, Designer Development, Development, Event, Firebird, InterBase, Package Development, Software Development, SQL Server, Visual Studio and tools, XML, XML/XSD | Leave a Comment »

.NET/C# – obtaining information through WMI

Posted by jpluimers on 2009/04/25

WMI (Windows Management Instrumentation) is a way of obtaining information from your PC that otherwise might be hard to find.
WMI is based on Common Information Model (CIM), so you’ll see an example of that too.

There is one drawback: for a lot of the WMI, you need to have enough privileges (like: being an admin, which none of you should be, right?).
So beware!

You can use WMI from C#, but you have to generate the C# classes for the WMI classes first.

I’ll show some examples for WMI Win32 classes, as I needed some of those classes recently myself.

Before I forget:
in order to browse through the WMI Win32 object instances, you can download this nifty WMI Administrative Tools toolset from the Microsoft MSDN site. Note that these are from 2002, and they only reliably work from within Internet Explorer.
Read the rest of this entry »

Posted in .NET, C#, Development, Software Development, Visual Studio and tools | Leave a Comment »