(Disclaimer, no clue where this originated, but I stole it from TW)
If Facebook Existed Years Ago
C# – List of Exceptions
C# – OpenFileDialog
Prelude: After finding that I was not using my blog at all I decided it was time for a change. So going forward I’m going to be using my blog to post little pieces of code that I find useful, usually pieces that I can never remember how to implement without having to search for. I’m sure from time to time I’ll still post some ramblings, but essentially this blog is going full nerd.
C# – OpenFileDialog
The OpenFileDialog, as you may have already guessed, is used to display the dialog for opening files in DotNet. There are basically two ways to use it, the first is through the control, the second is through the object instance.
Control:
Pretty straight forward, just drag the control onto your form.
Once that is done the control will appear in the bottom control bar (in VS).
From there you can set all of the properties for the control in the Properties window.
Note: You can find a complete listing of the properties here.
Since all of the properties are set in the control, there is no need to set them in the code (although you still can of course). Implementation from there is simple.
if (openFileDialog1.ShowDialog() == DialogResult.OK)
MessageBox.Show(openFileDialog1.FileName);
The ShowDialog() method is what does the work and actually displays the Windows dialog, to which you’re looking for a return value of DialogResult.Ok.
That’s more or less it for the control, pretty simple.
Object:
Using the OpenFileDialog as an object only really requires one more line of code, the creation of the object itself.
OpenFileDialog openFileDialog = new OpenFileDialog();
However, since there is no associated properties window we need to set the object properties in the code.
openFileDialog.InitialDirectory = @"C:\Users\Sean Thomas\Documents\"; openFileDialog.Filter = "PDF files (*.pdf)|*.txt|All files (*.*)|*.*"; openFileDialog.FilterIndex = 2;
The InitialDirectory and Filter are probably the two most widely used properties for this class. InitialDirectory is pretty straight forward, just sets the directory displayed when the ShowDialog() method is called. The Filter
property on the other hand is used to control the file filter dropdown on the dialog. The basic form for the property is <Display Text>|<Extension>. Each extension set is separated with a pipe.
Note: You can find a complete listing of the properties here.
From there the implementation is virtually the same as the control.
if (openFileDialog.ShowDialog() == DialogResult.OK)
MessageBox.Show(openFileDialog.FileName);
Again, you’re looking for the return value of DialogResult.Ok.
Summary:
The OpenFileDialog class is a very simple, yet powerful class with many ways to customize it for use. Similar to the OpenFileDialog class is it’s sister class; OpenFolderDialog (I’ll assume you can guess what it’s for).
For the complete write-up on the class check the MSDN documentation here.
Posted in coding, csharp, example, openfiledialog | Tags: coding, csharp, example, openfiledialog
Protection, it’s not just for sex.
As a general rule of thumb I can expect at least one phone call a month from a friend who has inevitably found themselves a nice new virus on the internet to download and run. Of course it’s never intentional, but then again it’s avoidable.
Think of the internet as a fair or carnival. Sure it can be a lot of fun; food, games, rides and nakkid chicks……ok, so maybe the last one you won’t find at the fair, but follow me on this…
Think of the food, games and rides as the “seemingly” safe places on the internet; online banking, Oprah.com, Wikipedia & Facebook. Why seemingly safe? Well that’s where the human variable comes into place; Did that guy wash his hands before he made your food? Was that fat slimy disease infested grease ball in the same seats as you on the ride? Where are my pants? Same goes for “safe” internet sites, just because it looks safe doesn’t mean it is safe.
Take Facebook and its latest virus, sent as a message (or wall post) from one of your friends. However the fact that your friend actually sent it is the furthest thing from the truth. It has actually been sent by a computer virus you downloaded from, most likely, completely different site.
So like any encounter with a circus midget, there is something you can do, get protection!
Depending on your level of dedication there are a number of options, but basically it comes down to if you want to pay for it or not. Paying for software doesn’t mean it’s better, but it at least gives a bit more of a comfort level.
However there is a new option when it comes to free antivirus software now, and it’s actually a good one. Microsoft, yes, I said Microsoft. Queue tinfoil hats and MS bashing.
Microsoft has finally ponied up and created (or rather purchased) their own antivirus package; MS Security Essentials. You can download it here.
If you want something a little more encompassing try Norton 360, I highly recommend it. You can buy it here.
Posted in microsoft, technology, virus | Tags: antivirus, microsoft, norton, save yourself!
Cool Flip-Style Clock Screensaver
I’ve been told that sometimes the simplest things in life are the best, and I can’t agree more. Take for example; an Aston Martin, a vacation house in the Bahamas and a supermodel girlfriend, three simple things that would make me very happy.
Since I can’t quite afford any of those I have to compromise.
Screensavers are very simple and people love these things; fish tanks, fires, waterfalls and nakkid chicks! Unfortunately we have this “policy” at the office about having nudity on our screensavers, geesh, losers. Thankfully I’ve found the next best thing……ok, maybe not next best thing, but it’s pretty freaking cool.
Let me introduce you to the FLIQLO (no clue, don’t ask), it’s an old-school flip-style clock (as pictured below) and is available for download here.
Update: It appears as FLIQLO has updated the SS for Windows 7.
Enjoy.

Posted in apple, cool, microsoft, misc, screensaver, technology | Tags: cool, mac, screensaver, windows
Why Live In The Frozen North?
Because shit like this only exists on the National Geographic channel!
Screw world peace, screw global warming, screw H1N1, we need to band together as a planet and eliminate these things. How do you even kill something like this? Run it over with your car? Pretty sure that would just piss it off, and it would find you, while you slept! Clearly the only solution is to nuke it from orbit.
(It’s a Golden Orb Weaver spider found throughout the southern US, in case this thing isn’t freaky enough, they have been known to EAT BIRDS!)

Posted in spiders, wtf | Tags: end of the world, nuke it from orbit, spiders, wtf
People of Wal-Mart
I really don’t know what to say, I thought Jackson Square was an interesting place to visit, apparently it has nothing on Wal-Mart.
Enjoy, courtesy of www.peopleofwalmart.com (sadly they have a lot more pics).
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
|
|
![]() |
![]() |
![]() |
We are so screwed

Seeing bears scale walls on ladders puts us one step from living in “the Golden Compass”, where armoured bears form an army of indestructible killing machines, but at least their discovery of this Rosetta Stone, the key to unlocking new ways to catch and eat us, was a random accident that couldn’t be avoided.
A bear that got stuck in a skateboard park climbed up a ladder to make its escape. The animal had been stuck in the sunken skating bowl overnight and could not get up the steep-sided concrete walls on its own. Officials in the town of Snowmass, Colorado lowered down a long ladder, which the bear walked across before heading back to the woods. The bear was uninjured by its experience.
Well Jesus don’t teach the bears how to climb ladders! We need those walls, to separate the bears from our succulent arms and legs. What’s the second part of your plan, coat doorknobs in honey? Jesus Fuckin Christ, I’m scared to even turn around right now, one of these new Super Bears may have snuck up behind me.
(From What Would Tyler Durden Do [WWTDD rules, but does contain some not so work safe material])
Posted in humor | Tags: bye bye humans, death, humor, super bears
Does Microsoft Hate Black People?
Or maybe it’s just Poland that does, you decide for yourself.
Check out these two links, one is from the US Microsoft site, the second is from the Polish Microsoft site.
Seems Microsoft actually “Photoshopped” (badly I might add) out the black person on the Polish site.
Below is both images side by side for reference (or for when MS “adjusts” their site images).

Nothing Like BBQ’d Babies!
Having the friends over this summer for a BBQ? How about some BBQ’d babies! Troubles finding the perfect grill for the occasion? Try Sears under the category: Human Cooking > Grills to Cook Babies and More > Body Part Roaster.

Pic courtesy of Sears.com (of course they have since taken it down……probably sold out of em!)









