Microsoft .NET related stuff
This is basically a list of stuff which I have found useful in various projects I have worked on. If you find it useful, then great! If not, then SHAME ON YOU!
- System.Diagnostics - checking if your process is already running
- MAPI in .NET
- GDI - Image resizing on the fly
- HTTP - Retrieving a page
- Class Create
- HTTP - Scam Baiting - Using HTTP POST
- You know Figlet, on *NIX machines, where you type in some text, and it prints it BIG? Well, here's my effort:
- .NET Date Format
If you only want one copy of your application running, then this is the code for you. This will check if your process is already running - if it is, it'll warn you and then exit.
A few basic pointers to getting started with MAPI in .NET. It's a bit of a pig, but if you can get it to work, you'll have lots of fun, HONEST!
Useful for displaying thumbnails on your website, but you don't want the hassle of actually storing a smaller version of the image. I use this code myself in the Photo Galleries.
This function just retrieves the page given a URL. Very handy to have around. I use it all the time (honestly!).
This is a little program I wrote which connects to an MS SQL database and lets you build wrapper classes for a given table in your choice of C# or VB.NET.
I got one of those Halifax scam emails - you know the ones, where they ask you to input all your security details in a webpage which looks just like the bank's page, but isn't. So somebody gets hold of your details and steals all your money? Well, I wrote a program to continuously submit random rubbish to one of these sites and (in theory) fill the hacker's (*cough cough*) database with useless rubbish. It's not pretty, but it only took 5 minutes. Here's the results.
BTW, I left this program running all night, and by the next morning the scam website had vanished. Now, I don't claim full credit for this, but I like to think I played a part :)
Sick of farting about with the date format trying to stop it coming up in US format all the time?! I know I am. Here's the solution...
A choice quote from Usenet:
"If C# truly could do everything that VB.Net could, then I would have already jumped ship. But after playing with it for nearly a year, I have found C# to be more of a hack than a well designed language"[View the whole text here.]
Yes, it's true. VB.NET is the most wonderful creation, and C# was just thrown together as an afterthought.
As you may have guessed, I prefer the C# world (and Java, C, and other C-style languages). However, given that VB.NET
and C# are just about entirely interchangable, I can easily write VB.net if I really have to. And I frequently do. But if at all possible,
I like to write code in C#.
But remember, the B of VB stands for BASIC.. And the B of BASIC stands for BEGINNER'S.