Dan Mackey On ColdFusion Development

ColdFusion, Java, .NET, AJAX, DHTML development and general programming. Daniel is owner and Administrator of CFTagStore.com and works for an Application Development Company in Ireland called Digital Crew. His interests cover all areas of programming in multiple languages with a particular interest in Internet Technologies.

All Articles tagged : .NET
2008-01-07 16:08:00.0

Silverlight Vs Flex - Good article from a developers point of view

I found a very interesting article today on a subject that is of particular interest to me at the moment. I am in the need of a good gantt chart component (for integration with www.teamworkpm.net) and after searching high and low, have come to the conclusion that it may be worth building one myself. The nature of the component means that AJAX is out (I want it to be extremely functional and fast)

My problem is that I am not very good at flash. I tried Flex Builder 3 but I have a whole load of experience with C# so I was considering silverlight. I find the IDE of Visual Studio amazing so Silverlight in C# would be a very attractive option. The Flex Builder app (Eclipse plugin/mod) just didnt do it for me....

This article though has put me in 2 minds. They make the very good point that Flex has been along for so long that there are so many resources available to developers. And of course there is the added bonus of being able to deploy as an AIR application.

After reading the article, I have decided to put the effort into Flex development. Can anybody point me in the direction of the best Flex for beginners articles, samples etc?

Tags: .NET | Adobe AIR
Add to your del.icio.us    DIGG This!    Technorati Cosmos Link    Post to Reddit    Add to your Furl    Add to Blinklist
Comments [11] - Leave a comment
2007-01-24 20:01:00.0

Retrieving Non-Volatile USB Serial Number Using C# .NET

This is something I meant to post up ages ago as information and solutions are hard to come by on this specific topic.

The problem all stems from the fact that the USB specification does not require a hard coded serial number as mandatory for USB devices, especially memory sticks although in my tests 99% of sticks did in fact have an OEM serial number.

Windows secifies its own serial number for each device which is volatile meaning the serial number is erased and renewed everytime the USB stick is formatted. This causes problems when your using your stick as a security device or dongle. Basically, in Windows if you get 2 devices from the same manufacturer without OEM numbers, it gets confused. Not sure about a Mac or Linux.

Anyways, to the point of this article.....how do we actually get the OEM serail so a device can be formatted over and over again and you can still tell the drive apart from another one?

Well, there are 2 ways. Using the registry or using something called a Win32 WMI Provider. WMI is a database of all aspects of your operating system and hardware and is used by Windows to hold everything together. Infact the WMI is a all held in the regisrty but the provider using management classes lets you query it using SQL.

You need to add a reference to your C Sharp program to SYSTEM.MANAGEMENT.

Step 1 is to query the Win32_LogicalDiskToPartition section and get all the logical disk names e.g: F:\ and mapped enumeration which have a big long string attached like so : 000000001

This will give us the enumeration of the drive so we can then strip off the int at the end and query the Win32_DiskDrive. The drive we are looking for will be in the form \\\\.\\PHYSICALDRIVE(enumeration(enumeration) where (enumeration) is the bit we found out above. The PNPDeviceID is the full non-volatile serial number which with a bit of parsing we can retrieve the actual serial number.

It may sound confusing reading the above so the best thing to do is look at the attached source. I have wrapped it all up into a class that can be called as follows:

USBSerialNumber usb = new USBSerialNumber();
string serial = usb.getSerialNumberFromDriveLetter("f:\"Wink;

You can download the class by clicking the image below:

Download USBSerialNumber Class

Hope you like it and it saves you some time!

UPDATE Thursday 10th May 2007
You can download a test project from here : USBSerialNumberTest.zip

Tags: .NET | My Work
Add to your del.icio.us    DIGG This!    Technorati Cosmos Link    Post to Reddit    Add to your Furl    Add to Blinklist
Comments [22] - Leave a comment
2006-10-24 23:40:00.0

I love C# and Visual Studio

As mentioned in my last post, I am learning C# and so far I am loving it!

I have a pretty cool ColdFusion based Live Support application written and started the Operators console in Visual Basic 6 but I decided there is no better way to learn a new language than having to learn it in a productive way. I decided to put the VB6 version on hold and redo it in C#.

And you know what? Its fun! It reminds me of why I love programming so much. The satisfaction of actually accomplishing what you set out to do is second to none.

For me to be completely comfortable with my choice of switching languages, I decided to take all the knowledge I have in Visual Basic and make itty bitty projects accomplishing a specific area. I was pretty hot on the WebBrowser control and could beat it into any shape I wanted so that was the first thing I wanted to do.

Tonight I developed a full tabbed browser in C# with the ability to:

  • Add Tabs
  • Delete Tabs
  • Capture events from the DOM of the selected tab page
  • Interface with my C# application from the JS in the webpage.

The reason I need this is because the ColdFusion Live Support Application takes chat requests from a queue and when accepted by the operator, a new tab is created to hold the chat.

This was a major effort in Visual Basic 6 but it has taken me just under 1 1/2 hours tonight. I even went a bit further and created the whole thing in a reusable class for other projects.

I am really getting to love Object Orientated Programming and hope to use what I learned tonight for my next ColdFusion and Javascript projects.

Tags: .NET | ColdFusion
Add to your del.icio.us    DIGG This!    Technorati Cosmos Link    Post to Reddit    Add to your Furl    Add to Blinklist
Comments [3] - Leave a comment